Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

what's the dimension of TLAT and TLON in pop2

wenq@pku_edu_cn

New Member
Dear CESM/POP community,       I'm trying to specify the North Atlantic region by using 'if':     do i = 1,nx_block
        do j = 1,ny_block
         if ( (TLAT(i,j)*radian > 0. .and. TLAT(i,j)*radian  < 90.) .and.((TLON(i,j)*radian > 280. .and. TLON(i,j)*radian 0. .and. TLON(i,j)*radian < 30.)) ) then
        TRACER(i,j,1,2,curtime,iblock) = TRACER(i,j,1,2,oldtime,iblock)
        TRACER(i,j,1,2,oldtime,iblock) = TRACER(i,j,1,2,oldtime,iblock)
        TRACER(i,j,1,2,newtime,iblock) = TRACER(i,j,1,2,oldtime,iblock)
        end if
        end do
     end do      when I build the code, it told me that:/lustre/wenqing/cesm/run/sss_fixed_NA/ocn/source/step_mod.F90(509): error #6351: The number of subscripts is incorrect.   [TLAT]
         if ( (TLAT(i,j)*radian > 0. .and. TLAT(i,j)*radian  < 90.) .and.((TLON(i,j)*radian > 280. .and. TLON(i,j)*radian 0. .and. TLAT(i,j)*radian  < 90.) .and.((TLON(i,j)*radian > 280. .and. TLON(i,j)*radian 0. .and. TLAT(i,j)*radian  < 90.) .and.((TLON(i,j)*radian > 280. .and. TLON(i,j)*radian 0. .and. TLAT(i,j)*radian  < 90.) .and.((TLON(i,j)*radian > 280. .and. TLON(i,j)*radian 0. .and. TLON(i,j)*radian < 30.)) ) then
-----------^
/lustre/wenqing/cesm/run/sss_fixed_NA/ocn/source/step_mod.F90(510): error #6351: The number of subscripts is incorrect.   [TLON]
          (TLON(i,j)*radian > 0. .and. TLON(i,j)*radian < 30.)) ) then
---------------------------------------^
compilation aborted for /lustre/wenqing/cesm/run/sss_fixed_NA/ocn/source/step_mod.F90 (code 1)         The dimension of TLAT and TLON is 2, So I don't known what's wrong with it? Any help would be greatly appreciated. Thanks.       Qin Wen   
 

njn01

Member
In POP2, the variables TLAT and TLON are in radians, and TLATD and TLOND are in degrees, so you can use either pair in your new code.The TLAT and TLON variables have three dimensions: grid-x direction, grid-y direction, and number of blocks (used in threading).  See the grid.F90 module for definitions.Take a look at code in the vmix_kpp.F90 module for an example of correct usage of TLATD and TLOND; TLAT and TLON would be used similarly, if you are using radians. 
 
Top