Changeset 470
- Timestamp:
- Dec 13, 2011, 12:15:50 PM (13 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r426 r470 552 552 libraries before compilation, which enforces that the gcm will fail to 553 553 compile if any routine failed to compile. 554 555 == 12/12/2011 == AS 556 - Use of allocatable arrays to set corrk stuff through reading *.dat files, without the need to change radinc_h manually. 557 - Allocation is done in sugas_corrk which is within firstcall loop in callcorrk. 558 - Note that N_LGAUSS is still a parameter. It is not supposed to change much. 559 - Compiles fine. Tested with debugging options through pgdbg. Runs fine. Exact same results in Early Mars test case. 560 561 Modified files: 562 M 469 libf/phystd/physiq.F90 563 M 469 libf/phystd/sugas_corrk.F90 564 M 469 libf/phystd/callcorrk.F90 565 M 469 libf/phystd/radinc_h.F90 566 M 469 libf/phystd/radcommon_h.F90 -
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r374 r470 892 892 endif 893 893 894 !!! see physiq.F for explanations about CLFvarying. This is temporary. 895 if (lastcall .and. .not.CLFvarying) then 896 IF( ALLOCATED( gasi ) ) DEALLOCATE( gasi ) 897 IF( ALLOCATED( gasv ) ) DEALLOCATE( gasv ) 898 IF( ALLOCATED( pgasref ) ) DEALLOCATE( pgasref ) 899 IF( ALLOCATED( tgasref ) ) DEALLOCATE( tgasref ) 900 IF( ALLOCATED( wrefvar ) ) DEALLOCATE( wrefvar ) 901 IF( ALLOCATED( pfgasref ) ) DEALLOCATE( pfgasref ) 902 endif 903 894 904 end subroutine callcorrk -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r368 r470 724 724 if(CLFvarying)then 725 725 726 !!! THIS IS NOT A VERY GOOD STRATEGY HERE (everything should be in callcorrk) 727 !!! ---> PROBLEMS WITH ALLOCATED ARRAYS 728 !!! (temporary solution in callcorrk: do not deallocate if CLFvarying ...) 729 726 730 clearsky=.true. 727 731 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & -
trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90
r135 r470 72 72 REAL*8 blamv(L_NSPECTV+1) ! these are needed by suaer.F90 73 73 74 real*8 gasi(L_NTREF,L_PINT,L_REFVAR,L_NSPECTI,L_NGAUSS) 75 real*8 gasv(L_NTREF,L_PINT,L_REFVAR,L_NSPECTV,L_NGAUSS) 74 !!! ALLOCATABLE STUFF SO THAT DIMENSIONS ARE READ in *.dat FILES -- AS 12/2011 75 REAL*8, DIMENSION(:,:,:,:,:), ALLOCATABLE :: gasi, gasv 76 REAL*8, DIMENSION(:), ALLOCATABLE :: PGASREF, TGASREF, WREFVAR, PFGASREF 76 77 real*8 FZEROI(L_NSPECTI) 77 78 real*8 FZEROV(L_NSPECTV) 78 real*8 PGASREF(L_NPREF), TGASREF(L_NTREF)79 79 real*8 pgasmin, pgasmax 80 80 real*8 tgasmin, tgasmax … … 88 88 real gir(L_NSPECTI,naerkind,nsizemax) 89 89 90 real*8 WREFVAR(L_REFVAR)91 90 92 91 ! Reference wavelengths used to compute reference optical depth (m) … … 119 118 120 119 real*8 PTOP, TAUREF(L_LEVELS+1) 121 real*8 pfgasref(L_PINT) ! finer reference grid for some reason122 120 123 121 real*8, parameter :: UBARI = 0.5D0 -
trunk/LMDZ.GENERIC/libf/phystd/radinc_h.F90
r368 r470 60 60 integer, parameter :: L_NLEVRAD = llm+1 61 61 62 ! Below are various parameter combinations that will work for the 63 ! radiative datasets indicated. For the moment, you must change these 64 ! values manually before compiling, each time you want to change the 65 ! dataset. 66 62 !!!! THIS IS SET IN sugas_corrk 63 !!!! [use of allocatable arrays] -- AS 12/2011 64 integer :: L_NPREF, L_NTREF, L_REFVAR, L_PINT 65 66 !!! THIS ONE DOES NOT CHANGE MUCH... IT CAN BE REGARDED AS A CONSTANT. 67 67 integer, parameter :: L_NGAUSS = 17 68 69 integer, parameter :: L_NPREF = 970 integer, parameter :: L_NTREF = 771 integer, parameter :: L_REFVAR = 7 ! earth / earlymars72 ! ! CO2_H2Ovar / N2OCO2rich_H2Ovar / N2OCO2poor_H2Ovar73 ! integer, parameter :: L_REFVAR = 4 ! N2_CH474 75 ! integer, parameter :: L_NPREF = 876 ! integer, parameter :: L_NTREF = 1177 ! integer, parameter :: L_REFVAR = 8 ! N2_H2Ovar78 79 ! integer, parameter :: L_NPREF = 880 ! integer, parameter :: L_NTREF = 581 ! integer, parameter :: L_REFVAR = 1 ! therm_test282 83 ! integer, parameter :: L_NPREF = 1284 ! integer, parameter :: L_NTREF = 2085 ! integer, parameter :: L_REFVAR = 1 ! null (for H2 etc.)86 87 ! integer, parameter :: L_NPREF = 1088 ! integer, parameter :: L_NTREF = 589 ! integer, parameter :: L_REFVAR = 7 ! N2_CO2var90 91 ! integer, parameter :: L_NPREF = 892 ! integer, parameter :: L_NTREF = 693 ! integer, parameter :: L_REFVAR = 1 ! pureCO294 95 ! integer, parameter :: L_NPREF = 796 ! integer, parameter :: L_NTREF = 597 ! integer, parameter :: L_REFVAR = 1 ! degraded_pure98 99 ! integer, parameter :: L_NPREF = 9100 ! integer, parameter :: L_NTREF = 14101 ! integer, parameter :: L_REFVAR = 1 ! megaCO2102 68 103 69 integer, parameter :: L_NSPECTI = NBinfrared 104 70 integer, parameter :: L_NSPECTV = NBvisible 105 71 106 integer, parameter :: L_PINT = (L_NPREF-1)*5+1107 72 integer, parameter :: NAERKIND = 2 108 73 real, parameter :: L_TAUMAX = 35 -
trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90
r374 r470 34 34 35 35 integer n, nt, np, nh, ng, nw, m, i 36 integer L_NGAUSScheck , L_NPREFcheck, L_NTREFcheck, L_REFVARcheck36 integer L_NGAUSScheck 37 37 38 38 character(len=100) :: file_id 39 39 character(len=300) :: file_path 40 40 41 real*8 gasi8(L_NTREF,L_NPREF,L_REFVAR,L_NSPECTI,L_NGAUSS)42 real*8 gasv8(L_NTREF,L_NPREF,L_REFVAR,L_NSPECTV,L_NGAUSS)41 !! ALLOCATABLE ARRAYS -- AS 12/2011 42 REAL*8, DIMENSION(:,:,:,:,:), ALLOCATABLE :: gasi8, gasv8 43 43 44 44 real*8 x, xi(4), yi(4), ans, p … … 103 103 enddo 104 104 105 ! check the array size is correct, load the coefficients 106 open(111,file=file_path(1:LEN_TRIM(file_path)),form='formatted') 107 read(111,*) L_REFVARcheck 108 if(.not.(L_REFVARcheck.eq.L_REFVAR)) then 109 print*, L_REFVARcheck 110 print*, L_REFVAR 111 print*,'The size of your radiative transfer mixing ratio array does ' 112 print*,'not match the value given in Q.dat, exiting.' 113 print*,'Check the value of L_NREFVAR in radinc_h.F90.' 114 call abort 115 endif 105 ! GET array size, load the coefficients 106 open(111,file=TRIM(file_path),form='formatted') 107 read(111,*) L_REFVAR 108 IF( .NOT. ALLOCATED( wrefvar ) ) ALLOCATE( WREFVAR(L_REFVAR) ) 116 109 read(111,*) wrefvar 117 110 close(111) … … 165 158 read(111,*) gweight 166 159 close(111) 167 160 168 161 ! display the values 169 162 print*,'Correlated-k g-space grid:' … … 194 187 call abort 195 188 endif 196 197 ! check the array size is correct, load the coefficients189 190 ! GET array size, load the coefficients 198 191 open(111,file=TRIM(file_path),form='formatted') 199 read(111,*) L_NPREFcheck 200 if(.not.(L_NPREFcheck.eq.L_NPREF)) then 201 print*,'The size of your radiative transfer pressure array does ' 202 print*,'not match the value given in p.dat, exiting.' 203 call abort 204 endif 192 read(111,*) L_NPREF 193 IF( .NOT. ALLOCATED( pgasref ) ) ALLOCATE( PGASREF(L_NPREF) ) 205 194 read(111,*) pgasref 206 195 close(111) 196 L_PINT = (L_NPREF-1)*5+1 197 IF( .NOT. ALLOCATED( pfgasref ) ) ALLOCATE( PFGASREF(L_PINT) ) 198 207 199 208 200 ! display the values … … 244 236 endif 245 237 246 ! check the array size is correct, load the coefficients238 ! GET array size, load the coefficients 247 239 open(111,file=TRIM(file_path),form='formatted') 248 read(111,*) L_NTREFcheck 249 if(.not.(L_NTREFcheck.eq.L_NTREF)) then 250 print*,'The size of your radiative transfer temperature array does ' 251 print*,'not match the value given in T.dat, exiting.' 252 call abort 253 endif 240 read(111,*) L_NTREF 241 IF( .NOT. ALLOCATED( tgasref ) ) ALLOCATE( TGASREF(L_NTREF) ) 254 242 read(111,*) tgasref 255 243 close(111) … … 264 252 tgasmin = tgasref(1) 265 253 tgasmax = tgasref(L_NTREF) 254 255 256 !----------------------------------------------------------------------- 257 !----------------------------------------------------------------------- 258 ! ALLOCATE THE MULTIDIM ARRAYS IN radcommon_h 259 PRINT *, L_NTREF,L_NPREF,L_REFVAR 260 IF( .NOT. ALLOCATED( gasi8 ) ) ALLOCATE( gasi8(L_NTREF,L_NPREF,L_REFVAR,L_NSPECTI,L_NGAUSS) ) 261 IF( .NOT. ALLOCATED( gasv8 ) ) ALLOCATE( gasv8(L_NTREF,L_NPREF,L_REFVAR,L_NSPECTV,L_NGAUSS) ) 262 IF( .NOT. ALLOCATED( gasi ) ) ALLOCATE( gasi(L_NTREF,L_PINT,L_REFVAR,L_NSPECTI,L_NGAUSS) ) 263 IF( .NOT. ALLOCATED( gasv ) ) ALLOCATE( gasv(L_NTREF,L_PINT,L_REFVAR,L_NSPECTV,L_NGAUSS) ) 264 !----------------------------------------------------------------------- 265 !----------------------------------------------------------------------- 266 267 266 268 267 269 !======================================================================= … … 308 310 read(111,*) gasi8 309 311 close(111) 310 312 311 313 do nw=1,L_NSPECTI 312 314 fzeroi(nw) = 0. … … 530 532 enddo 531 533 534 !!! DEALLOCATE LOCAL ARRAYS 535 IF( ALLOCATED( gasi8 ) ) DEALLOCATE( gasi8 ) 536 IF( ALLOCATED( gasv8 ) ) DEALLOCATE( gasv8 ) 537 IF( ALLOCATED( pgasref ) ) DEALLOCATE( pgasref ) 538 539 532 540 return 533 541 end subroutine sugas_corrk
Note: See TracChangeset
for help on using the changeset viewer.