azhang76@gatech_edu
New Member
Hello,I am trying to test a latitude dependence parameterization in CAM5's deep convection code (zm_conv and zm_conv_intr). But I'm struggling with calling the latitude from the environment. I tried two methods to find the latitude in CAM code: 1. by calling 'state' and use 'state%lat' as the latitude2. by calling functions 'get_rlat_p' or 'get_rlat_all_p' to transfer latitude based on lchnk and pcol indexI output both ways but none of them have a good cover of latitudes. In the log file:Aoxing:lat= -1.57079632679490 1.57079632679490 -1.37237994867344 1.37237994867344 -1.07475538149124 1.07475538149124 -0.876339003369784 0.876339003369785 -0.578714436187594 0.578714436187593 -0.347228661712556 0.347228661712556 -4.960409453036532E-002 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 lchnk= 184 Aoxing:lat= -1.57079632679490 1.57079632679490 -1.37237994867344 1.37237994867344 -1.07475538149124 1.07475538149124 -0.876339003369784 0.876339003369785 -0.578714436187594 0.578714436187593 -0.347228661712556 0.347228661712556 -4.960409453036532E-002 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 lchnk= 181 Aoxing:lat= -1.57079632679490 1.57079632679490 -1.37237994867344 1.37237994867344 -1.07475538149124 1.07475538149124 -0.876339003369784 0.876339003369785 -0.578714436187594 0.578714436187593 -0.347228661712556 0.347228661712556 -4.960409453036532E-002 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 lchnk= 185 Aoxing:lat= -1.57079632679490 1.57079632679490 -1.37237994867344 1.37237994867344 -1.07475538149124 1.07475538149124 -0.876339003369784 0.876339003369785 -0.578714436187594 0.578714436187593 -0.347228661712556 0.347228661712556 -4.960409453036532E-002 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 lchnk= 182 Aoxing:lat= -1.57079632679490 1.57079632679490 -1.37237994867344 1.37237994867344 -1.07475538149124 1.07475538149124 -0.876339003369784 0.876339003369785 -0.578714436187594 0.578714436187593 -0.347228661712556 0.347228661712556 -4.960409453036532E-002 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 lchnk= 186 Aoxing:lat= -1.57079632679490 1.57079632679490 -1.37237994867344 1.37237994867344 -1.07475538149124 1.07475538149124 -0.876339003369784 0.876339003369785 -0.578714436187594 0.578714436187593 -0.347228661712556 0.347228661712556 -4.960409453036532E-002 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 lchnk= 183It seems to have only 6 chunks (181-186) and all of them have the same 16 latitudes which dont look like to cover all the latitudes (I'm using f09 grids which have 96 gridboxs for latitude). my change of code looks like: (in zm_conv.f90): ncol = get_ncols_p( lchnk )call get_rlat_all_p(lchnk, ncol, rlat)if (m .eq. icnst_BC_A1) write(iulog,*) "Aoxing:lat=",rlat, "lchnk=", lchnk I also have trouble understanding the 'pcols' and 'ncol' in CAM codes. How are they used in different cases? I checked the other codes trying to use latitude, they are all in a "do i=1,ncol" loop, but my change is in a 'do i=0,pcols' loop, not sure if it is part of the reason I'm not getting there... Please let me know if any other info needed. Thanks!Aoxing