Changeset 2972 for trunk/LMDZ.GENERIC
- Timestamp:
- May 29, 2023, 12:41:48 PM (18 months ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/deftank/callphys.GJ581d
r1784 r2972 97 97 ## Tracer and aerosol options 98 98 ## ~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 # Number of radiatively active aerosols 100 naerkind=1 99 101 # Radiatively active CO2 aerosol? 100 102 aeroco2 = .true. -
trunk/LMDZ.GENERIC/deftank/callphys.earlymars
r1784 r2972 75 75 sedimentation = .false. 76 76 77 77 78 ## Other physics options 78 79 ## ~~~~~~~~~~~~~~~~~~~~~ … … 92 93 ## Tracer and aerosol options 93 94 ## ~~~~~~~~~~~~~~~~~~~~~~~~~~ 95 # Number of radiatively active aerosols 96 naerkind=2 94 97 # Radiatively active CO2 aerosol? 95 98 aeroco2 = .true. -
trunk/LMDZ.GENERIC/deftank/callphys.earth
r1784 r2972 91 91 ## Tracer and aerosol options 92 92 ## ~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 # Number of radiatively active aerosols 94 naerkind=1 93 95 # Radiatively active CO2 aerosol? 94 96 aeroco2 = .false. -
trunk/LMDZ.GENERIC/deftank/callphys.kcm1d
r1784 r2972 64 64 ## Tracer and aerosol options 65 65 ## ~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 # Number of radiatively active aerosols 67 naerkind=0 66 68 # Fixed aerosol distributions? 67 69 aerofixed = .true. -
trunk/LMDZ.GENERIC/libf/phystd/aeroptproperties.F90
r2899 r2972 44 44 45 45 ! ============================================================= 46 LOGICAL, PARAMETER :: varyingnueff(naerkind) = .false. 46 ! LOGICAL, PARAMETER :: varyingnueff(naerkind) = .false. ! not used! 47 47 ! ============================================================= 48 48 … … 105 105 REAL,SAVE :: logvratgrid,vratgrid 106 106 ! Grid used to remember which calculation is done 107 LOGICAL,SAVE :: checkgrid(refftabsize,nuefftabsize,naerkind,2) = .false.107 LOGICAL,SAVE,ALLOCATABLE :: checkgrid(:,:,:,:) 108 108 !$OMP THREADPRIVATE(refftab,nuefftab,logvratgrid,vratgrid,checkgrid) 109 109 ! Optical properties of the grid (VISIBLE) 110 REAL,SAVE :: qsqrefVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)111 REAL,SAVE :: qextVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)112 REAL,SAVE :: qscatVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)113 REAL,SAVE :: omegVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)114 REAL,SAVE :: gVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)110 REAL,SAVE,ALLOCATABLE :: qsqrefVISgrid(:,:,:,:) 111 REAL,SAVE,ALLOCATABLE :: qextVISgrid(:,:,:,:) 112 REAL,SAVE,ALLOCATABLE :: qscatVISgrid(:,:,:,:) 113 REAL,SAVE,ALLOCATABLE :: omegVISgrid(:,:,:,:) 114 REAL,SAVE,ALLOCATABLE :: gVISgrid(:,:,:,:) 115 115 !$OMP THREADPRIVATE(qsqrefVISgrid,qextVISgrid,qscatVISgrid,omegVISgrid,gVISgrid) 116 116 ! Optical properties of the grid (INFRARED) 117 REAL,SAVE :: qsqrefIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)118 REAL,SAVE :: qextIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)119 REAL,SAVE :: qscatIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)120 REAL,SAVE :: omegIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)121 REAL,SAVE :: gIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)117 REAL,SAVE,ALLOCATABLE :: qsqrefIRgrid(:,:,:,:) 118 REAL,SAVE,ALLOCATABLE :: qextIRgrid(:,:,:,:) 119 REAL,SAVE,ALLOCATABLE :: qscatIRgrid(:,:,:,:) 120 REAL,SAVE,ALLOCATABLE :: omegIRgrid(:,:,:,:) 121 REAL,SAVE,ALLOCATABLE :: gIRgrid(:,:,:,:) 122 122 !$OMP THREADPRIVATE(qsqrefIRgrid,qextIRgrid,qscatIRgrid,omegIRgrid,gIRgrid) 123 123 ! Optical properties of the grid (REFERENCE WAVELENGTHS) 124 REAL,SAVE :: qrefVISgrid(refftabsize,nuefftabsize,naerkind)125 REAL,SAVE :: qscatrefVISgrid(refftabsize,nuefftabsize,naerkind)126 REAL,SAVE :: qrefIRgrid(refftabsize,nuefftabsize,naerkind)127 REAL,SAVE :: qscatrefIRgrid(refftabsize,nuefftabsize,naerkind)128 REAL,SAVE :: omegrefVISgrid(refftabsize,nuefftabsize,naerkind)129 REAL,SAVE :: omegrefIRgrid(refftabsize,nuefftabsize,naerkind)124 REAL,SAVE,ALLOCATABLE :: qrefVISgrid(:,:,:) 125 REAL,SAVE,ALLOCATABLE :: qscatrefVISgrid(:,:,:) 126 REAL,SAVE,ALLOCATABLE :: qrefIRgrid(:,:,:) 127 REAL,SAVE,ALLOCATABLE :: qscatrefIRgrid(:,:,:) 128 REAL,SAVE,ALLOCATABLE :: omegrefVISgrid(:,:,:) 129 REAL,SAVE,ALLOCATABLE :: omegrefIRgrid(:,:,:) 130 130 !$OMP THREADPRIVATE(qrefVISgrid,qscatrefVISgrid,qrefIRgrid,qscatrefIRgrid,omegrefVISgrid,& 131 131 !$OMP omegrefIRgrid) 132 132 ! Firstcall 133 133 LOGICAL,SAVE :: firstcall = .true. 134 !$OMP THREADPRIVATE(firstcall) 134 LOGICAL,SAVE :: first_allocate=.true. 135 !$OMP THREADPRIVATE(firstcall,first_allocate) 135 136 ! Variables used by the Gauss-Legendre integration: 136 REAL,SAVE :: normd(refftabsize,nuefftabsize,naerkind,2)137 REAL,SAVE :: dista(refftabsize,nuefftabsize,naerkind,2,ngau)138 REAL,SAVE :: distb(refftabsize,nuefftabsize,naerkind,2,ngau)137 REAL,SAVE,ALLOCATABLE :: normd(:,:,:,:) 138 REAL,SAVE,ALLOCATABLE :: dista(:,:,:,:,:) 139 REAL,SAVE,ALLOCATABLE :: distb(:,:,:,:,:) 139 140 !$OMP THREADPRIVATE(normd,dista,distb) 140 141 141 REAL,SAVE :: radGAUSa(ngau,naerkind,2)142 REAL,SAVE :: radGAUSb(ngau,naerkind,2)142 REAL,SAVE,ALLOCATABLE :: radGAUSa(:,:,:) 143 REAL,SAVE,ALLOCATABLE :: radGAUSb(:,:,:) 143 144 !$OMP THREADPRIVATE(radGAUSa,radGAUSb) 144 145 145 REAL,SAVE :: qsqrefVISa(L_NSPECTV,ngau,naerkind)146 REAL,SAVE :: qrefVISa(ngau,naerkind)147 REAL,SAVE :: qsqrefVISb(L_NSPECTV,ngau,naerkind)148 REAL,SAVE :: qrefVISb(ngau,naerkind)149 REAL,SAVE :: omegVISa(L_NSPECTV,ngau,naerkind)150 REAL,SAVE :: omegrefVISa(ngau,naerkind)151 REAL,SAVE :: omegVISb(L_NSPECTV,ngau,naerkind)152 REAL,SAVE :: omegrefVISb(ngau,naerkind)153 REAL,SAVE :: gVISa(L_NSPECTV,ngau,naerkind)154 REAL,SAVE :: gVISb(L_NSPECTV,ngau,naerkind)155 !$OMP THREADPRIVATE(qsqrefVISa,qrefVISa,qsqrefVISb,qrefVISb,omegVISa, & 156 !$OMPomegrefVISa,omegVISb,omegrefVISb,gVISa,gVISb)157 158 REAL,SAVE :: qsqrefIRa(L_NSPECTI,ngau,naerkind)159 REAL,SAVE :: qrefIRa(ngau,naerkind)160 REAL,SAVE :: qsqrefIRb(L_NSPECTI,ngau,naerkind)161 REAL,SAVE :: qrefIRb(ngau,naerkind)162 REAL,SAVE :: omegIRa(L_NSPECTI,ngau,naerkind)163 REAL,SAVE :: omegrefIRa(ngau,naerkind)164 REAL,SAVE :: omegIRb(L_NSPECTI,ngau,naerkind)165 REAL,SAVE :: omegrefIRb(ngau,naerkind)166 REAL,SAVE :: gIRa(L_NSPECTI,ngau,naerkind)167 REAL,SAVE :: gIRb(L_NSPECTI,ngau,naerkind)168 !$OMP THREADPRIVATE(qsqrefIRa,qrefIRa,qsqrefIRb,qrefIRb,omegIRa,omegrefIRa,& 169 !$OMPomegIRb,omegrefIRb,gIRa,gIRb)146 REAL,SAVE,ALLOCATABLE :: qsqrefVISa(:,:,:) 147 REAL,SAVE,ALLOCATABLE :: qrefVISa(:,:) 148 REAL,SAVE,ALLOCATABLE :: qsqrefVISb(:,:,:) 149 REAL,SAVE,ALLOCATABLE :: qrefVISb(:,:) 150 !$OMP THREADPRIVATE(qsqrefVISa,qrefVISa,qsqrefVISb,qrefVISb) 151 REAL,SAVE,ALLOCATABLE :: omegVISa(:,:,:) 152 REAL,SAVE,ALLOCATABLE :: omegrefVISa(:,:) 153 REAL,SAVE,ALLOCATABLE :: omegVISb(:,:,:) 154 REAL,SAVE,ALLOCATABLE :: omegrefVISb(:,:) 155 REAL,SAVE,ALLOCATABLE :: gVISa(:,:,:) 156 REAL,SAVE,ALLOCATABLE :: gVISb(:,:,:) 157 !$OMP THREADPRIVATE(omegVISa,omegrefVISa,omegVISb,omegrefVISb,gVISa,gVISb) 158 159 REAL,SAVE,ALLOCATABLE :: qsqrefIRa(:,:,:) 160 REAL,SAVE,ALLOCATABLE :: qrefIRa(:,:) 161 REAL,SAVE,ALLOCATABLE :: qsqrefIRb(:,:,:) 162 REAL,SAVE,ALLOCATABLE :: qrefIRb(:,:) 163 !$OMP THREADPRIVATE(qsqrefIRa,qrefIRa,qsqrefIRb,qrefIRb) 164 REAL,SAVE,ALLOCATABLE :: omegIRa(:,:,:) 165 REAL,SAVE,ALLOCATABLE :: omegrefIRa(:,:) 166 REAL,SAVE,ALLOCATABLE :: omegIRb(:,:,:) 167 REAL,SAVE,ALLOCATABLE :: omegrefIRb(:,:) 168 REAL,SAVE,ALLOCATABLE :: gIRa(:,:,:) 169 REAL,SAVE,ALLOCATABLE :: gIRb(:,:,:) 170 !$OMP THREADPRIVATE(omegIRa,omegrefIRa,omegIRb,omegrefIRb,gIRa,gIRb) 170 171 171 172 REAL :: radiusm … … 197 198 ! REAL :: omegaREFvis3d(ngrid,nlayer,naerkind) 198 199 ! REAL :: omegaREFir3d(ngrid,nlayer,naerkind) 200 201 ! 0. Allocate local saved arrays at firstcall 202 ! -------------------------------------------------- 203 IF (first_allocate) THEN 204 ! Grid used to remember computations already done at previous calls 205 ALLOCATE(checkgrid(refftabsize,nuefftabsize,naerkind,2)) 206 checkgrid(:,:,:,:)=.false. 207 ! Optical properties of the grid (VISIBLE) 208 ALLOCATE(qsqrefVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)) 209 ALLOCATE(qextVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)) 210 ALLOCATE(qscatVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)) 211 ALLOCATE(omegVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)) 212 ALLOCATE(gVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)) 213 ! Optical properties of the grid (INFRARED) 214 ALLOCATE(qsqrefIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)) 215 ALLOCATE(qextIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)) 216 ALLOCATE(qscatIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)) 217 ALLOCATE(omegIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)) 218 ALLOCATE(gIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)) 219 ! Optical properties of the grid (REFERENCE WAVELENGTHS) 220 ALLOCATE(qrefVISgrid(refftabsize,nuefftabsize,naerkind)) 221 ALLOCATE(qscatrefVISgrid(refftabsize,nuefftabsize,naerkind)) 222 ALLOCATE(qrefIRgrid(refftabsize,nuefftabsize,naerkind)) 223 ALLOCATE(qscatrefIRgrid(refftabsize,nuefftabsize,naerkind)) 224 ALLOCATE(omegrefVISgrid(refftabsize,nuefftabsize,naerkind)) 225 ALLOCATE(omegrefIRgrid(refftabsize,nuefftabsize,naerkind)) 226 ! Variables used by the Gauss-Legendre integration: 227 ALLOCATE(normd(refftabsize,nuefftabsize,naerkind,2)) 228 ALLOCATE(dista(refftabsize,nuefftabsize,naerkind,2,ngau)) 229 ALLOCATE(distb(refftabsize,nuefftabsize,naerkind,2,ngau)) 230 ALLOCATE(radGAUSa(ngau,naerkind,2)) 231 ALLOCATE(radGAUSb(ngau,naerkind,2)) 232 ! 233 ALLOCATE(qsqrefVISa(L_NSPECTV,ngau,naerkind)) 234 ALLOCATE(qrefVISa(ngau,naerkind)) 235 ALLOCATE(qsqrefVISb(L_NSPECTV,ngau,naerkind)) 236 ALLOCATE(qrefVISb(ngau,naerkind)) 237 ALLOCATE(omegVISa(L_NSPECTV,ngau,naerkind)) 238 ALLOCATE(omegrefVISa(ngau,naerkind)) 239 ALLOCATE(omegVISb(L_NSPECTV,ngau,naerkind)) 240 ALLOCATE(omegrefVISb(ngau,naerkind)) 241 ALLOCATE(gVISa(L_NSPECTV,ngau,naerkind)) 242 ALLOCATE(gVISb(L_NSPECTV,ngau,naerkind)) 243 ! 244 ALLOCATE(qsqrefIRa(L_NSPECTI,ngau,naerkind)) 245 ALLOCATE(qrefIRa(ngau,naerkind)) 246 ALLOCATE(qsqrefIRb(L_NSPECTI,ngau,naerkind)) 247 ALLOCATE(qrefIRb(ngau,naerkind)) 248 249 ALLOCATE(omegIRa(L_NSPECTI,ngau,naerkind)) 250 ALLOCATE(omegrefIRa(ngau,naerkind)) 251 ALLOCATE(omegIRb(L_NSPECTI,ngau,naerkind)) 252 ALLOCATE(omegrefIRb(ngau,naerkind)) 253 ALLOCATE(gIRa(L_NSPECTI,ngau,naerkind)) 254 ALLOCATE(gIRb(L_NSPECTI,ngau,naerkind)) 255 256 first_allocate=.false. 257 ENDIF ! of IF (first_allocate) 199 258 200 259 DO iaer = 1, naerkind ! Loop on aerosol kind … … 260 319 261 320 firstcall = .false. 262 ENDIF 321 ENDIF ! of IF (firstcall) 263 322 264 323 ! 1.4 Radius middle point and range for Gauss integration … … 755 814 ENDDO ! iaer (loop on aerosol kind) 756 815 757 RETURN758 816 END SUBROUTINE aeroptproperties 759 817 -
trunk/LMDZ.GENERIC/libf/phystd/aerosol_mod.F90
r2898 r2972 193 193 if (is_master) then 194 194 print*, 'Aerosols counted not equal to naerkind' 195 print*, 'Compile with tag -s',ia,'to run' 196 print*, 'or change options in callphys.def' 195 print*, 'set correct value for nearkind in callphys.def' 196 print*, 'which should be ',ia 197 print*, 'according to current options in callphys.def' 198 print*, 'or change/correct incompatible options there' 197 199 print*, 'Abort in iniaerosol' 198 200 endif -
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r2960 r2972 117 117 118 118 119 ! Globally varying aerosol optical properties on GCM grid ; not needed everywhere so not in radcommon_h. 120 REAL :: QVISsQREF3d(ngrid,nlayer,L_NSPECTV,naerkind) 121 REAL :: omegaVIS3d(ngrid,nlayer,L_NSPECTV,naerkind) 122 REAL :: gVIS3d(ngrid,nlayer,L_NSPECTV,naerkind) 123 REAL :: QIRsQREF3d(ngrid,nlayer,L_NSPECTI,naerkind) 124 REAL :: omegaIR3d(ngrid,nlayer,L_NSPECTI,naerkind) 125 REAL :: gIR3d(ngrid,nlayer,L_NSPECTI,naerkind) 119 ! Globally varying aerosol optical properties on GCM grid ; not needed everywhere so not in radcommon_h. 120 ! made "save" variables so they are allocated once in for all, not because 121 ! the values need be saved from a time step to the next 122 REAL,SAVE,ALLOCATABLE :: QVISsQREF3d(:,:,:,:) 123 REAL,SAVE,ALLOCATABLE :: omegaVIS3d(:,:,:,:) 124 REAL,SAVE,ALLOCATABLE :: gVIS3d(:,:,:,:) 125 !$OMP THREADPRIVATE(QVISsQREF3d,omegaVIS3d,gVIS3d) 126 REAL,SAVE,ALLOCATABLE :: QIRsQREF3d(:,:,:,:) 127 REAL,SAVE,ALLOCATABLE :: omegaIR3d(:,:,:,:) 128 REAL,SAVE,ALLOCATABLE :: gIR3d(:,:,:,:) 129 !$OMP THREADPRIVATE(QIRsQREF3d,omegaIR3d,gIR3d) 126 130 127 131 ! REAL :: omegaREFvis3d(ngrid,nlayer,naerkind) … … 155 159 REAL*8,allocatable,save :: taucumi(:,:,:) 156 160 !$OMP THREADPRIVATE(tauv,taucumv,taucumi) 157 REAL*8 tauaero(L_LEVELS,naerkind) 161 REAL*8,allocatable,save :: tauaero(:,:) 162 !$OMP THREADPRIVATE(tauaero) 158 163 REAL*8 nfluxtopv,nfluxtopi,nfluxtop,fluxtopvdn 159 164 REAL*8 nfluxoutv_nu(L_NSPECTV) ! Outgoing band-resolved VI flux at TOA (W/m2). … … 231 236 232 237 ! test on allocated necessary because of CLFvarying (two calls to callcorrk in physiq) 238 if(.not.allocated(QVISsQREF3d)) then 239 allocate(QVISsQREF3d(ngrid,nlayer,L_NSPECTV,naerkind)) 240 endif 241 if(.not.allocated(omegaVIS3d)) then 242 allocate(omegaVIS3d(ngrid,nlayer,L_NSPECTV,naerkind)) 243 endif 244 if(.not.allocated(gVIS3d)) then 245 allocate(gVIS3d(ngrid,nlayer,L_NSPECTV,naerkind)) 246 endif 247 if (.not.allocated(QIRsQREF3d)) then 248 allocate(QIRsQREF3d(ngrid,nlayer,L_NSPECTI,naerkind)) 249 endif 250 if (.not.allocated(omegaIR3d)) then 251 allocate(omegaIR3d(ngrid,nlayer,L_NSPECTI,naerkind)) 252 endif 253 if (.not.allocated(gIR3d)) then 254 allocate(gIR3d(ngrid,nlayer,L_NSPECTI,naerkind)) 255 endif 256 if (.not.allocated(tauaero)) then 257 allocate(tauaero(L_LEVELS,naerkind)) 258 endif 259 233 260 if(.not.allocated(QXVAER)) then 234 261 allocate(QXVAER(L_LEVELS,L_NSPECTV,naerkind), stat=ok) 235 262 if (ok /= 0) then 236 263 write(*,*) "memory allocation failed for QXVAER!" 237 call abort_physic(subname,'allocation failure ifor QXVAER',1)264 call abort_physic(subname,'allocation failure for QXVAER',1) 238 265 endif 239 266 endif -
trunk/LMDZ.GENERIC/libf/phystd/callsedim.F
r2671 r2972 54 54 55 55 ! for particles with varying radii: 56 real reffrad(ngrid,nlay,naerkind) ! particle radius (m) 57 real nueffrad(ngrid,nlay,naerkind) ! aerosol effective radius variance 56 real,allocatable,save :: reffrad(:,:,:) ! particle radius (m) 57 real,allocatable,save :: nueffrad(:,:,:) ! aerosol effective radius variance 58 !$OMP THREADPRIVATE(reffrad,nueffrad) 58 59 59 60 real zqi(ngrid,nlay,nq) ! to locally store tracers … … 79 80 stop 80 81 endif 82 ! allocate "naerkind" size local arrays (which are also 83 ! "saved" so that this is done only once in for all even if 84 ! we don't need to store the value from a time step to the next) 85 allocate(reffrad(ngrid,nlay,naerkind)) 86 allocate(nueffrad(ngrid,nlay,naerkind)) 81 87 ENDIF ! of IF (firstcall) 82 88 -
trunk/LMDZ.GENERIC/libf/phystd/condense_co2.F90
r1543 r2972 6 6 pdtc,pdtsrfc,pdpsrfc,pdqc) 7 7 8 use radinc_h, only : L_NSPECTV , naerkind8 use radinc_h, only : L_NSPECTV 9 9 use gases_h, only: gfrac, igas_co2 10 10 use radii_mod, only : co2_reffrad -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
r2785 r2972 29 29 USE vertical_layers_mod, ONLY: init_vertical_layers 30 30 USE logic_mod, ONLY: hybrid 31 use radinc_h, only: naerkind 31 32 use regular_lonlat_mod, only: init_regular_lonlat 32 33 use planete_mod, only: ini_planete_mod … … 154 155 c INITIALISATION 155 156 c======================================================================= 157 ! check if 'rcm1d.def' file is around 158 open(90,file='rcm1d.def',status='old',form='formatted', 159 & iostat=ierr) 160 if (ierr.ne.0) then 161 write(*,*) 'Cannot find required file "rcm1d.def"' 162 write(*,*) 'which should contain some input parameters' 163 write(*,*) ' ... might as well stop here ...' 164 stop 165 else 166 close(90) 167 endif 168 169 ! now, run.def is needed anyway. so we create a dummy temporary one 170 ! for ioipsl to work. if a run.def is already here, stop the 171 ! program and ask the user to do a bit of cleaning 172 open(90,file='run.def',status='old',form='formatted', 173 & iostat=ierr) 174 if (ierr.eq.0) then 175 close(90) 176 write(*,*) 'There is already a run.def file.' 177 write(*,*) 'This is not compatible with 1D runs.' 178 write(*,*) 'Please remove the file and restart the run.' 179 write(*,*) 'Runtime parameters are supposed to be in rcm1d.def' 180 stop 181 else 182 call system('touch run.def') 183 call system("echo 'INCLUDEDEF=callphys.def' >> run.def") 184 call system("echo 'INCLUDEDEF=rcm1d.def' >> run.def") 185 endif 156 186 157 187 ! read nq from traceur.def … … 187 217 ! Initialize dimphy module 188 218 call init_dimphy(1,llm) 219 189 220 ! now initialize arrays using phys_state_var_init 221 ! but first initialise naerkind (from callphys.def) 222 naerkind=0 !default 223 call getin("naerkind",naerkind) 224 190 225 call phys_state_var_init(nq) 191 226 … … 221 256 c ------------------------------------------------------ 222 257 223 ! check if 'rcm1d.def' file is around224 open(90,file='rcm1d.def',status='old',form='formatted',225 & iostat=ierr)226 if (ierr.ne.0) then227 write(*,*) 'Cannot find required file "rcm1d.def"'228 write(*,*) 'which should contain some input parameters'229 write(*,*) ' ... might as well stop here ...'230 stop231 else232 close(90)233 endif234 235 ! now, run.def is needed anyway. so we create a dummy temporary one236 ! for ioipsl to work. if a run.def is already here, stop the237 ! program and ask the user to do a bit of cleaning238 open(90,file='run.def',status='old',form='formatted',239 & iostat=ierr)240 if (ierr.eq.0) then241 close(90)242 write(*,*) 'There is already a run.def file.'243 write(*,*) 'This is not compatible with 1D runs.'244 write(*,*) 'Please remove the file and restart the run.'245 write(*,*) 'Runtime parameters are supposed to be in rcm1d.def'246 stop247 else248 call system('touch run.def')249 call system("echo 'INCLUDEDEF=callphys.def' >> run.def")250 call system("echo 'INCLUDEDEF=rcm1d.def' >> run.def")251 endif252 258 253 259 ! check if we are going to run with or without tracers -
trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
r2958 r2972 11 11 use init_print_control_mod, only: init_print_control 12 12 use radinc_h, only: ini_radinc_h, naerkind 13 use radcommon_h, only: ini_radcommon_h 13 14 use radii_mod, only: radfixed, Nmix_co2 14 15 use datafile_mod, only: datadir … … 615 616 if (is_master) write(*,*)trim(rname)//": Nmix_co2 = ",Nmix_co2 616 617 617 ! write(*,*)"Number of radiatively active aerosols:" 618 ! naerkind=0. ! default value 619 ! call getin_p("naerkind",naerkind) 620 ! write(*,*)" naerkind = ",naerkind 618 if (is_master) write(*,*)trim(rname)//& 619 "Number of radiatively active aerosols:" 620 naerkind=0 ! default value 621 call getin_p("naerkind",naerkind) 622 if (is_master) write(*,*)trim(rname)//": naerkind = ",naerkind 621 623 622 624 if (is_master) write(*,*)trim(rname)//": Opacity of dust (if used):" … … 1159 1161 ! initialize variables in radinc_h 1160 1162 call ini_radinc_h(nlayer,tplanckmin,tplanckmax,dtplanck) 1161 1163 1164 ! initialize variables and allocate arrays in radcommon_h 1165 call ini_radcommon_h(naerkind) 1166 1162 1167 ! allocate "comsoil_h" arrays 1163 1168 call ini_comsoil_h(ngrid) -
trunk/LMDZ.GENERIC/libf/phystd/optci.F90
r2957 r2972 58 58 real*8,intent(in) :: GIAER(L_LEVELS,L_NSPECTI,NAERKIND) 59 59 real*8,intent(in) :: TAUAERO(L_LEVELS,NAERKIND) 60 real*8 TAUAEROLK(L_LEVELS,L_NSPECTI,NAERKIND) 61 real*8 TAEROS(L_LEVELS,L_NSPECTI,NAERKIND) 60 61 ! local variables (saved for convenience as need be allocated) 62 real*8,save,allocatable :: TAUAEROLK(:,:,:) 63 real*8,save,allocatable :: TAEROS(:,:,:) 64 !$OMP THREADPRIVATE(TAUAEROLK,TAEROS) 62 65 63 66 integer L, NW, NG, K, LK, IAER … … 94 97 95 98 integer interm 99 100 logical :: firstcall=.true. 101 !$OMP THREADPRIVATE(firstcall) 96 102 97 103 !--- Kasting's CIA ---------------------------------------- … … 107 113 ! -1.7,-1.7,-1.7,-1.7,-1.7,-1.7,-1.7, -1.7,0.0 ] 108 114 !---------------------------------------------------------- 115 116 if (firstcall) then 117 ! allocate local arrays of size "naerkind" (which are also 118 ! "saved" so that this is done only once in for all even if 119 ! we don't need to store the value from a time step to the next) 120 allocate(TAUAEROLK(L_LEVELS,L_NSPECTI,NAERKIND)) 121 allocate(TAEROS(L_LEVELS,L_NSPECTI,NAERKIND)) 122 firstcall=.false. 123 endif ! of if (firstcall) 109 124 110 125 !! AS: to save time in computing continuum (see bilinearbig) -
trunk/LMDZ.GENERIC/libf/phystd/optcv.F90
r2875 r2972 47 47 48 48 49 real*8 DTAUV(L_NLAYRAD,L_NSPECTV,L_NGAUSS)49 real*8,intent(out) :: DTAUV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 50 50 real*8 DTAUKV(L_LEVELS,L_NSPECTV,L_NGAUSS) 51 real*8 TAUV(L_NLEVRAD,L_NSPECTV,L_NGAUSS)52 real*8 TAUCUMV(L_LEVELS,L_NSPECTV,L_NGAUSS)53 real*8 PLEV(L_LEVELS)54 real*8 TMID(L_LEVELS), PMID(L_LEVELS)55 real*8 COSBV(L_NLAYRAD,L_NSPECTV,L_NGAUSS)56 real*8 WBARV(L_NLAYRAD,L_NSPECTV,L_NGAUSS)51 real*8,intent(out) :: TAUV(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 52 real*8,intent(out) :: TAUCUMV(L_LEVELS,L_NSPECTV,L_NGAUSS) 53 real*8,intent(in) :: PLEV(L_LEVELS) 54 real*8,intent(in) :: TMID(L_LEVELS), PMID(L_LEVELS) 55 real*8,intent(out) :: COSBV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 56 real*8,intent(out) :: WBARV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 57 57 58 58 ! for aerosols 59 real*8 QXVAER(L_LEVELS,L_NSPECTV,NAERKIND) 60 real*8 QSVAER(L_LEVELS,L_NSPECTV,NAERKIND) 61 real*8 GVAER(L_LEVELS,L_NSPECTV,NAERKIND) 62 real*8 TAUAERO(L_LEVELS,NAERKIND) 63 real*8 TAUAEROLK(L_LEVELS,L_NSPECTV,NAERKIND) 64 real*8 TAEROS(L_LEVELS,L_NSPECTV,NAERKIND) 59 real*8,intent(in) :: QXVAER(L_LEVELS,L_NSPECTV,NAERKIND) 60 real*8,intent(in) :: QSVAER(L_LEVELS,L_NSPECTV,NAERKIND) 61 real*8,intent(in) :: GVAER(L_LEVELS,L_NSPECTV,NAERKIND) 62 real*8,intent(in) :: TAUAERO(L_LEVELS,NAERKIND) 63 64 ! local arrays (saved for convenience as need be allocated) 65 real*8,save,allocatable :: TAUAEROLK(:,:,:) 66 real*8,save,allocatable :: TAEROS(:,:,:) 67 !$OMP THREADPRIVATE(TAUAEROLK,TAEROS) 65 68 66 69 integer L, NW, NG, K, LK, IAER 67 70 integer MT(L_LEVELS), MP(L_LEVELS), NP(L_LEVELS) 68 71 real*8 ANS, TAUGAS 69 real*8 72 real*8,intent(in) :: TAURAY(L_NSPECTV) 70 73 real*8 TRAY(L_LEVELS,L_NSPECTV) 71 74 real*8 DPR(L_LEVELS), U(L_LEVELS) 72 75 real*8 LCOEF(4), LKCOEF(L_LEVELS,4) 73 76 74 real*8 taugsurf(L_NSPECTV,L_NGAUSS-1)77 real*8,intent(out) :: taugsurf(L_NSPECTV,L_NGAUSS-1) 75 78 real*8 DCONT,DAERO 76 79 real*8 DRAYAER … … 79 82 80 83 ! variable species mixing ratio variables 81 real*8 QVAR(L_LEVELS), WRATIO(L_LEVELS), MUVAR(L_LEVELS) 84 real*8,intent(in) :: QVAR(L_LEVELS) 85 real*8,intent(in) :: MUVAR(L_LEVELS) 86 real*8 :: WRATIO(L_LEVELS) 82 87 real*8 KCOEF(4) 83 88 integer NVAR(L_LEVELS) … … 99 104 100 105 integer interm 106 107 logical :: firstcall=.true. 108 !$OMP THREADPRIVATE(firstcall) 109 110 if (firstcall) then 111 ! allocate local arrays of size "naerkind" (which are also 112 ! "saved" so that this is done only once in for all even if 113 ! we don't need to store the value from a time step to the next) 114 allocate(TAUAEROLK(L_LEVELS,L_NSPECTV,NAERKIND)) 115 allocate(TAEROS(L_LEVELS,L_NSPECTV,NAERKIND)) 116 firstcall=.false. 117 endif ! of if (firstcall) 101 118 102 119 !! AS: to save time in computing continuum (see bilinearbig) -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r2958 r2972 20 20 use gases_h, only: gnom, gfrac 21 21 use radcommon_h, only: sigma, glat, grav, BWNV, WNOI, DWNI, DWNV, WNOV 22 use suaer_corrk_mod, only: suaer_corrk 22 23 use radii_mod, only: h2o_reffrad, co2_reffrad 23 24 use aerosol_mod, only: iniaerosol, iaero_co2, iaero_h2o … … 260 261 ! for the "naerkind" optically active aerosols: 261 262 262 real aerosol(ngrid,nlayer,naerkind) ! Aerosols. 263 real,save,allocatable :: aerosol(:,:,:) ! Aerosols 264 !$OMP THREADPRIVATE(aerosol) 263 265 real zh(ngrid,nlayer) ! Potential temperature (K). 264 266 real pw(ngrid,nlayer) ! Vertical velocity (m/s). (NOTE : >0 WHEN DOWNWARDS !!) … … 342 344 REAL,allocatable,save :: zdqchim(:,:,:) ! Calchim_asis routine 343 345 REAL,allocatable,save :: zdqschim(:,:) ! Calchim_asis routine 346 !$OMP THREADPRIVATE(zdqchim,zdqschim) 344 347 345 348 REAL array_zero1(ngrid) … … 441 444 real muvar(ngrid,nlayer+1) ! For Runaway Greenhouse 1D study. By RW 442 445 443 real reffcol(ngrid,naerkind) 446 real,save,allocatable :: reffcol(:,:) 447 !$OMP THREADPRIVATE(reffcol) 444 448 445 449 ! Sourceevol for 'accelerated ice evolution'. By RW … … 513 517 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 514 518 call iniaerosol 519 ! allocate related local arrays 520 ! (need be allocated instead of automatic because of "naerkind") 521 allocate(aerosol(ngrid,nlayer,naerkind)) 522 allocate(reffcol(ngrid,naerkind)) 515 523 516 524 #ifdef CPP_XIOS -
trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90
r2297 r2972 1 1 module radcommon_h 2 2 use radinc_h, only: L_NSPECTI, L_NSPECTV, NTstart, NTstop, & 3 n aerkind, nsizemax3 nsizemax 4 4 implicit none 5 5 … … 93 93 !$OMP FZEROI,FZEROV) !pgasmin,pgasmax,tgasmin,tgasmax read by master in sugas_corrk 94 94 95 real QVISsQREF(L_NSPECTV,naerkind,nsizemax)96 real omegavis(L_NSPECTV,naerkind,nsizemax)97 real gvis(L_NSPECTV,naerkind,nsizemax)98 real QIRsQREF(L_NSPECTI,naerkind,nsizemax)99 real omegair(L_NSPECTI,naerkind,nsizemax)100 real gir(L_NSPECTI,naerkind,nsizemax)95 real,allocatable,save :: QVISsQREF(:,:,:) 96 real,allocatable,save :: omegavis(:,:,:) 97 real,allocatable,save :: gvis(:,:,:) 98 real,allocatable,save :: QIRsQREF(:,:,:) 99 real,allocatable,save :: omegair(:,:,:) 100 real,allocatable,save :: gir(:,:,:) 101 101 !$OMP THREADPRIVATE(QVISsQREF,omegavis,gvis,QIRsQREF,omegair,gir) 102 102 … … 105 105 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 106 107 REAL lamrefir(naerkind),lamrefvis(naerkind)108 107 real,allocatable,save :: lamrefir(:),lamrefvis(:) 108 !$OMP THREADPRIVATE(lamrefir,lamrefvis) 109 109 ! Actual number of grain size classes in each domain for a 110 110 ! given aerosol: 111 111 112 INTEGER :: nsize(naerkind,2) 112 integer,allocatable,save :: nsize(:,:) 113 !$OMP THREADPRIVATE(nsize) ! nsize filled by suaer_corrk 113 114 114 115 ! Particle size axis (depend on the kind of aerosol and the 115 116 ! radiation domain) 116 117 117 DOUBLE PRECISION :: radiustab(naerkind,2,nsizemax)118 !$OMP THREADPRIVATE( lamrefir,lamrefvis,radiustab) !nsize read by suaer_corrk118 double precision,allocatable,save :: radiustab(:,:,:) 119 !$OMP THREADPRIVATE(radiustab) 119 120 120 121 ! Extinction coefficient at reference wavelengths; … … 122 123 ! longrefvis and longrefir. 123 124 124 REAL :: QREFvis(naerkind,nsizemax)125 REAL :: QREFir(naerkind,nsizemax)125 real,allocatable,save :: QREFvis(:,:) 126 real,allocatable,save :: QREFir(:,:) 126 127 ! REAL :: omegaREFvis(naerkind,nsizemax) 127 REAL :: omegaREFir(naerkind,nsizemax)128 real,allocatable,save :: omegaREFir(:,:) 128 129 129 130 REAL,SAVE :: tstellar ! Stellar brightness temperature (SW) … … 160 161 !$OMP THREADPRIVATE(glat,eclipse) 161 162 163 contains 164 165 subroutine ini_radcommon_h(naerkind) 166 ! Initialize module variables 167 implicit none 168 integer,intent(in) :: naerkind 169 170 allocate(QVISsQREF(L_NSPECTV,naerkind,nsizemax)) 171 allocate(omegavis(L_NSPECTV,naerkind,nsizemax)) 172 allocate(gvis(L_NSPECTV,naerkind,nsizemax)) 173 allocate(QIRsQREF(L_NSPECTI,naerkind,nsizemax)) 174 allocate(omegair(L_NSPECTI,naerkind,nsizemax)) 175 allocate(gir(L_NSPECTI,naerkind,nsizemax)) 176 177 allocate(lamrefir(naerkind)) 178 allocate(lamrefvis(naerkind)) 179 allocate(nsize(naerkind,2)) 180 allocate(radiustab(naerkind,2,nsizemax)) 181 182 allocate(QREFvis(naerkind,nsizemax)) 183 allocate(QREFir(naerkind,nsizemax)) 184 allocate(omegaREFir(naerkind,nsizemax)) 185 186 end subroutine ini_radcommon_h 187 162 188 end module radcommon_h -
trunk/LMDZ.GENERIC/libf/phystd/radinc_h.F90
r2283 r2972 4 4 5 5 include "bands.h" 6 include "scatterers.h" 6 7 integer,save :: naerkind ! number of radiatively active aerosols 8 ! set via inifis 9 !$OMP THREADPRIVATE(naerkind) 7 10 8 11 !====================================================================== -
trunk/LMDZ.GENERIC/libf/phystd/suaer_corrk.F90
r2831 r2972 1 subroutine suaer_corrk 1 module suaer_corrk_mod 2 3 implicit none 4 5 contains 6 7 subroutine suaer_corrk 2 8 3 9 ! inputs … … 10 16 use radcommon_h, only: radiustab,nsize,tstellar 11 17 use radcommon_h, only: qrefvis,qrefir,omegarefir !,omegarefvis 12 use aerosol_mod 18 use aerosol_mod, only: noaero,iaero_co2,iaero_h2o,iaero_dust,iaero_h2so4 19 use aerosol_mod, only: iaero_back2lay,iaero_nh3,iaero_nlay,iaero_aurora 20 use aerosol_mod, only: iaero_venus1,iaero_venus2,iaero_venus2p 21 use aerosol_mod, only: iaero_venus3,iaero_venusUV 22 use aerosol_mod, only: iaero_generic,i_rgcs_ice 13 23 use callkeys_mod, only: tplanet, optprop_back2lay_vis, optprop_back2lay_ir, & 14 24 optprop_aeronlay_vis, optprop_aeronlay_ir, & 15 25 aeronlay_lamref, nlayaero,aerogeneric 16 26 use tracer_h, only: noms 27 28 use mod_phys_lmdz_para, only : is_master, bcast 29 17 30 implicit none 18 31 … … 48 61 49 62 ! Optical properties (read in external ASCII files) 50 INTEGER ,SAVE:: nwvl ! Number of wavelengths in63 INTEGER :: nwvl ! Number of wavelengths in 51 64 ! the domain (VIS or IR), read by master 52 65 … … 55 68 56 69 REAL, DIMENSION(:),& 57 ALLOCATABLE , SAVE:: wvl ! Wavelength axis, read by master70 ALLOCATABLE :: wvl ! Wavelength axis, read by master 58 71 REAL, DIMENSION(:),& 59 ALLOCATABLE , SAVE:: radiusdyn ! Particle size axis, read by master72 ALLOCATABLE :: radiusdyn ! Particle size axis, read by master 60 73 61 74 REAL, DIMENSION(:,:),& 62 ALLOCATABLE , SAVE:: ep,& ! Extinction coefficient Qext, read by master75 ALLOCATABLE :: ep,& ! Extinction coefficient Qext, read by master 63 76 omeg,& ! Single Scattering Albedo, read by master 64 77 gfactor ! Assymetry Factor, read by master … … 95 108 ! Local saved variables: 96 109 97 CHARACTER(LEN=50), DIMENSION(naerkind,2), SAVE :: file_id98 !$OMP THREADPRIVATE(file_id) 110 CHARACTER(LEN=50),ALLOCATABLE :: file_id(:,:) 111 99 112 !---- Please indicate the names of the optical property files below 100 113 ! Please also choose the reference wavelengths of each aerosol … … 119 132 120 133 !-------------------------------------------------------------- 134 ! allocate file_id, as naerkind is a variable 135 allocate(file_id(naerkind,2)) 136 121 137 if (noaero) then 122 138 print*, 'naerkind= 0' … … 344 360 QIRsQREF(:,:,:) = 0.0 345 361 346 347 362 DO iaer = 1, naerkind ! Loop on aerosol kind 363 DO idomain = 1, 2 ! Loop on radiation domain (VIS or IR) 348 364 !================================================================== 349 365 ! 1. READ OPTICAL PROPERTIES … … 352 368 ! 1.1 Open the ASCII file 353 369 354 !$OMP MASTER 355 370 !!!!$OMP MASTER 371 if (is_master) then 372 356 373 INQUIRE(FILE=TRIM(datadir)//'/'//TRIM(aerdir)//& 357 374 '/'//TRIM(file_id(iaer,idomain)),& … … 415 432 ENDDO 416 433 434 endif ! of if (is_master) 435 436 ! broadcast nwvl and nsize to all cores 437 call bcast(nwvl) 438 call bcast(nsize) 439 417 440 ALLOCATE(wvl(nwvl)) ! wvl 418 441 ALLOCATE(radiusdyn(nsize(iaer,idomain))) ! radiusdyn … … 424 447 ! 1.3 Read the data 425 448 449 if (is_master) then 426 450 jfile = 1 427 451 endwhile = .false. … … 504 528 endif 505 529 506 !$OMP END MASTER 507 !$OMP BARRIER 508 509 510 530 endif ! of if (is_master) 531 532 ! broadcast arrays to all cores 533 call bcast(wvl) 534 call bcast(radiusdyn) 535 call bcast(ep) 536 call bcast(omeg) 537 call bcast(gfactor) 511 538 512 539 !================================================================== … … 588 615 589 616 590 ENDDO! isize (particle size) -------------------------------------617 ENDDO ! isize (particle size) ------------------------------------- 591 618 592 619 END SELECT domain … … 596 623 !======================================================================== 597 624 598 !$OMP BARRIER 599 !$OMP MASTER 600 IF (ALLOCATED(wvl)) DEALLOCATE(wvl) ! wvl 601 IF (ALLOCATED(radiusdyn)) DEALLOCATE(radiusdyn) ! radiusdyn 602 IF (ALLOCATED(ep)) DEALLOCATE(ep) ! ep 603 IF (ALLOCATED(omeg)) DEALLOCATE(omeg) ! omeg 604 IF (ALLOCATED(gfactor)) DEALLOCATE(gfactor) ! g 605 !$OMP END MASTER 606 !$OMP BARRIER 607 608 END DO ! Loop on iaer 609 END DO ! Loop on idomain 625 DEALLOCATE(wvl) ! wvl 626 DEALLOCATE(radiusdyn) ! radiusdyn 627 DEALLOCATE(ep) ! ep 628 DEALLOCATE(omeg) ! omeg 629 DEALLOCATE(gfactor) ! g 630 631 END DO ! Loop on iaer 632 END DO ! Loop on idomain 610 633 !======================================================================== 611 RETURN612 613 614 615 ENDsubroutine suaer_corrk634 635 ! cleanup 636 deallocate(file_id) 637 638 end subroutine suaer_corrk 616 639 640 end module suaer_corrk_mod
Note: See TracChangeset
for help on using the changeset viewer.