Changeset 1485 for trunk/LMDZ.GENERIC
- Timestamp:
- Oct 22, 2015, 4:31:35 PM (9 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r1484 r1485 1093 1093 1094 1094 == 14/10/2015 == MT 1095 - Cleanup of callcorrk.F90 1095 - Cleanup of callcorrk.F90. 1096 1096 1097 1097 == 15/10/2015 == MT 1098 1098 - Harmonization of the calculation of the surface tracer tendencies in physiq.F90. 1099 1100 == 22/10/2015 == MT 1101 - Cleaning of condense_co2.F90. -
trunk/LMDZ.GENERIC/libf/phystd/condense_co2.F90
r1484 r1485 1 1 subroutine condense_co2(ngrid,nlayer,nq,ptimestep, & 2 2 pcapcal,pplay,pplev,ptsrf,pt, & 3 p phi,pdt,pdu,pdv,pdtsrf,pu,pv,pq,pdq,&4 p iceco2,pdqsurfc,albedo,pemisurf,&3 pdt,pdtsrf,pq,pdq, & 4 pqsurf,pdqsurfc,albedo,pemisurf, & 5 5 albedo_bareground,albedo_co2_ice_SPECTV, & 6 pdtc,pdtsrfc,pdpsrf,pduc,pdvc, & 7 pdqc) 6 pdtc,pdtsrfc,pdpsrfc,pdqc) 8 7 9 8 use radinc_h, only : L_NSPECTV, naerkind … … 21 20 ! Purpose 22 21 ! ------- 23 ! Condense and/or sublime CO2 ice on the ground and in the 24 ! atmosphere, and sediment the ice. 22 ! Condense and/or sublime CO2 ice on the ground and in the atmosphere, and sediment the ice. 25 23 ! 26 24 ! Inputs 27 25 ! ------ 28 ! ngrid Number of vertical columns 29 ! nlayer Number of layers 30 ! pplay(ngrid,nlayer) Pressure layers 31 ! pplev(ngrid,nlayer+1) Pressure levels 32 ! pt(ngrid,nlayer) Temperature (in K) 33 ! ptsrf(ngrid) Surface temperature 26 ! ngrid Number of vertical columns. 27 ! nlayer Number of vertical layers. 28 ! nq Number of tracers. 29 ! ptimestep Duration of the physical timestep (s). 30 ! pplay(ngrid,nlayer) Pressure layers (Pa). 31 ! pplev(ngrid,nlayer+1) Pressure levels (Pa). 32 ! pt(ngrid,nlayer) Atmospheric Temperatures (K). 33 ! ptsrf(ngrid) Surface temperatures (K). 34 ! pq(ngrid,nlayer,nq) Atmospheric tracers mixing ratios (kg/kg of air). 35 ! pqsurf(ngrid,nq) Surface tracers (kg/m2). 34 36 ! 35 ! pdt(ngrid,nlayer) Time derivative before condensation/sublimation of pt 36 ! pdtsrf(ngrid) Time derivative before condensation/sublimation of ptsrf 37 ! pqsurf(ngrid,nq) Sedimentation flux at the surface (kg.m-2.s-1) 37 ! pdt(ngrid,nlayer) Time derivative before condensation/sublimation of pt. 38 ! pdtsrf(ngrid) Time derivative before condensation/sublimation of ptsrf. 39 ! pdq(ngrid,nlayer,nq) Time derivative before condensation/sublimation of 40 ! 41 ! albedo_bareground(ngrid) Albedo of the bare ground. 42 ! albedo_co2_ice_SPECTV(L_NSPECTV) Spectral albedo of CO2 ice. 38 43 ! 39 44 ! Outputs 40 45 ! ------- 41 ! pdpsrf(ngrid) \ Contribution of condensation/sublimation 42 ! pdtc(ngrid,nlayer) / to the time derivatives of Ps, pt, and ptsrf 43 ! pdtsrfc(ngrid) / 46 ! pdpsrfc(ngrid) \ Contribution of condensation/sublimation 47 ! pdtc(ngrid,nlayer) \ to the time derivatives of 48 ! pdtsrfc(ngrid) / Surface Pressure, Atmospheric Temperatures, 49 ! pdqsurfc(ngrid) / Surface Temperatures, Surface Tracers, 50 ! pdqc(ngrid,nlayer,nq) / and Atmospheric Tracers.* 51 ! 52 ! pemisurf(ngrid) Emissivity of the surface. 44 53 ! 45 54 ! Both 46 55 ! ---- 47 ! piceco2(ngrid) CO2 ice at the surface (kg/m2) 48 ! albedo(ngrid,L_NSPECTV) Spectral albedo at the surface 49 ! pemisurf(ngrid) Emissivity of the surface 56 ! albedo(ngrid,L_NSPECTV) Spectral albedo of the surface. 50 57 ! 51 58 ! Authors … … 57 64 !================================================================== 58 65 59 !----------------------------------------------------------------------- 60 ! Arguments 66 !-------------------------- 67 ! Arguments 68 !-------------------------- 69 61 70 62 71 INTEGER,INTENT(IN) :: ngrid … … 69 78 REAL,INTENT(IN) :: ptsrf(ngrid) 70 79 REAL,INTENT(IN) :: pt(ngrid,nlayer) 71 REAL,INTENT(IN) :: pphi(ngrid,nlayer)72 80 REAL,INTENT(IN) :: pdt(ngrid,nlayer) 73 REAL,INTENT(IN) :: pdu(ngrid,nlayer)74 REAL,INTENT(IN) :: pdv(ngrid,nlayer)75 81 REAL,INTENT(IN) :: pdtsrf(ngrid) 76 REAL,INTENT(IN) :: pu(ngrid,nlayer)77 REAL,INTENT(IN) :: pv(ngrid,nlayer)78 82 REAL,INTENT(IN) :: pq(ngrid,nlayer,nq) 83 REAL,INTENT(IN) :: pqsurf(ngrid,nq) 79 84 REAL,INTENT(IN) :: pdq(ngrid,nlayer,nq) 80 85 REAL,INTENT(IN) :: albedo_bareground(ngrid) 81 86 REAL,INTENT(IN) :: albedo_co2_ice_SPECTV(L_NSPECTV) 82 REAL,INTENT(INOUT) :: piceco2(ngrid) 83 REAL,INTENT(OUT) :: albedo(ngrid,L_NSPECTV) 87 REAL,INTENT(INOUT) :: albedo(ngrid,L_NSPECTV) 84 88 REAL,INTENT(OUT) :: pemisurf(ngrid) 85 89 REAL,INTENT(OUT) :: pdtc(ngrid,nlayer) 86 90 REAL,INTENT(OUT) :: pdtsrfc(ngrid) 87 REAL,INTENT(OUT) :: pdpsrf(ngrid) 88 REAL,INTENT(OUT) :: pduc(ngrid,nlayer) 89 REAL,INTENT(OUT) :: pdvc(ngrid,nlayer) 91 REAL,INTENT(OUT) :: pdpsrfc(ngrid) 90 92 REAL,INTENT(OUT) :: pdqc(ngrid,nlayer,nq) 91 93 REAL,INTENT(OUT) :: pdqsurfc(ngrid) 92 94 93 !----------------------------------------------------------------------- 94 ! Local variables 95 96 INTEGER l,ig,icap,ilay,it,iq,nw 97 98 REAL reffrad(ngrid,nlayer) ! radius (m) of the co2 ice particles 99 REAL*8 zt(ngrid,nlayer) 100 REAL zq(ngrid,nlayer,nq) 101 REAL zcpi 102 REAL ztcond (ngrid,nlayer) 103 REAL ztnuc (ngrid,nlayer) 104 REAL ztcondsol(ngrid) 105 REAL zcondicea(ngrid,nlayer), zcondices(ngrid) 106 REAL zfallice(ngrid), Mfallice(ngrid) 107 REAL zmflux(nlayer+1) 108 REAL zu(nlayer),zv(nlayer) 109 REAL ztsrf(ngrid) 110 REAL ztc(nlayer), ztm(nlayer+1) 111 REAL zum(nlayer+1) , zvm(nlayer+1) 112 LOGICAL condsub(ngrid) 113 REAL subptimestep 114 Integer Ntime 115 real masse (ngrid,nlayer), w(ngrid,nlayer,nq) 116 real wq(ngrid,nlayer+1) 117 real vstokes,reff 118 119 ! Special diagnostic variables 120 real tconda1(ngrid,nlayer) 121 real tconda2(ngrid,nlayer) 122 real zdtsig (ngrid,nlayer) 123 real zdt (ngrid,nlayer) 124 125 !----------------------------------------------------------------------- 126 ! Saved local variables 95 !------------------------------ 96 ! Local variables 97 !------------------------------ 98 99 INTEGER l,ig,icap,ilay,iq,nw,igas,it 100 101 REAL reffrad(ngrid,nlayer) ! Radius (m) of the CO2 ice particles. 102 REAL*8 zt(ngrid,nlayer) ! Updated Atmospheric Temperatures (K). 103 REAL ztsrf(ngrid) ! Updated Surface Temperatures (K). 104 REAL zq(ngrid,nlayer,nq) ! Updated Atmospheric tracers mixing ratios (kg/kg of air). 105 REAL piceco2(ngrid) ! Updated Surface Tracer (kg/m2). 106 REAL ztcond (ngrid,nlayer) ! Atmospheric Temperatures of condensation of CO2. 107 REAL ztnuc (ngrid,nlayer) ! Atmospheric Nucleation Temperatures. 108 REAL ztcondsol(ngrid) ! Temperatures of condensation of CO2 at the surface. 109 REAL zcondices(ngrid) ! Condensation rate on the ground (kg/m2/s). 110 REAL zfallice(ngrid) ! Flux of ice falling on the surface (kg/m2/s). 111 REAL Mfallice(ngrid) ! Total amount of ice fallen to the ground during the timestep (kg/m2). 112 REAL wq(ngrid,nlayer+1) ! Total amount of ice fallen to the ground during the timestep (kg/m2). 113 REAL subptimestep ! Duration of the subtimestep (s) for the sedimentation. 114 Integer Ntime ! Number of subtimesteps. 115 REAL masse (ngrid,nlayer) ! Mass of atmospheric layers (kg/m2) 116 REAL w(ngrid,nlayer,nq) ! 117 REAL vstokes,reff ! 118 REAL ppco2 ! 119 120 121 !------------------------------------------ 122 ! Saved local variables 123 !------------------------------------------ 124 127 125 128 126 REAL,SAVE :: latcond=5.9e5 129 127 REAL,SAVE :: ccond 130 REAL,SAVE :: cpice=1000.131 128 REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: emisref 132 !$OMP THREADPRIVATE(latcond,ccond,cpice,emisref) 133 129 !$OMP THREADPRIVATE(latcond,ccond,emisref) 134 130 LOGICAL,SAVE :: firstcall=.true. 135 131 !$OMP THREADPRIVATE(firstcall) 136 REAL,EXTERNAL :: SSUM137 138 REAL,EXTERNAL :: CBRT139 140 132 INTEGER,SAVE :: i_co2ice=0 ! co2 ice 141 133 !$OMP THREADPRIVATE(i_co2ice) 142 134 CHARACTER(LEN=20) :: tracername ! to temporarily store text 143 135 144 integer igas 145 146 real ppco2 147 148 !----------------------------------------------------------------------- 149 ! Initializations 150 151 pdqc(1:ngrid,1:nlayer,1:nq)=0 152 pdtc(1:ngrid,1:nlayer)=0 153 zq(1:ngrid,1:nlayer,1:nq)=0 154 zt(1:ngrid,1:nlayer)=0 155 156 ! Initialisation 136 137 !------------------------------------------------ 138 ! Initialization at the first call 139 !------------------------------------------------ 140 141 157 142 IF (firstcall) THEN 158 143 159 ALLOCATE(emisref(ngrid)) !! this should be deallocated in lastcall... 160 161 ! find CO2 ice tracer 144 ALLOCATE(emisref(ngrid)) 145 ! Find CO2 ice tracer. 162 146 do iq=1,nq 163 147 tracername=noms(iq) … … 167 151 enddo 168 152 169 write(*,*) "condense_co2: i_co2ice=",i_co2ice170 171 if((i_co2ice.lt.1))then172 print*,'In condens_cloud but no CO2 ice tracer, exiting.'173 print*,'Still need generalisation to arbitrary species!'174 stop175 endif153 write(*,*) "condense_co2: i_co2ice=",i_co2ice 154 155 if((i_co2ice.lt.1))then 156 print*,'In condens_cloud but no CO2 ice tracer, exiting.' 157 print*,'Still need generalisation to arbitrary species!' 158 stop 159 endif 176 160 177 161 ccond=cpp/(g*latcond) 178 162 print*,'In condens_cloud: ccond=',ccond,' latcond=',latcond 179 163 180 ! Prepare special treatment if gas is not pure CO2 181 !if (addn2) then 182 ! m_co2 = 44.01E-3 ! CO2 molecular mass (kg/mol) 183 ! m_noco2 = 28.02E-3 ! N2 molecular mass (kg/mol) 184 ! Compute A and B coefficient use to compute 185 ! mean molecular mass Mair defined by 186 ! 1/Mair = q(ico2)/m_co2 + (1-q(ico2))/m_noco2 187 ! 1/Mair = A*q(ico2) + B 188 ! A = (1/m_co2 - 1/m_noco2) 189 ! B = 1/m_noco2 190 !endif 191 192 ! Minimum CO2 mixing ratio below which mixing occurs with layer above: 193 !qco2min =0.75 164 ! Prepare special treatment if gas is not pure CO2 165 ! if (addn2) then 166 ! m_co2 = 44.01E-3 ! CO2 molecular mass (kg/mol) 167 ! m_noco2 = 28.02E-3 ! N2 molecular mass (kg/mol) 168 ! Compute A and B coefficient use to compute 169 ! mean molecular mass Mair defined by 170 ! 1/Mair = q(ico2)/m_co2 + (1-q(ico2))/m_noco2 171 ! 1/Mair = A*q(ico2) + B 172 ! A = (1/m_co2 - 1/m_noco2) 173 ! B = 1/m_noco2 174 ! endif 175 176 ! Minimum CO2 mixing ratio below which mixing occurs with layer above : qco2min =0.75 194 177 195 178 firstcall=.false. 196 179 ENDIF 197 zcpi=1./cpp 198 199 !----------------------------------------------------------------------- 200 ! Calculation of CO2 condensation / sublimation 201 ! 202 ! Variables used: 203 ! piceco2(ngrid) amount of co2 ice on the ground (kg/m2) 204 ! zcondicea(ngrid,l) condensation rate in layer l (kg/m2/s) 205 ! zcondices(ngrid) condensation rate on the ground (kg/m2/s) 206 ! zfallice(ngrid) flux of ice falling on surface (kg/m2/s) 207 ! pdtc(ngrid,nlayer) dT/dt due to phase changes (K/s) 208 209 210 ! Tendencies initially set to 0 (except pdtc) 211 DO l=1,nlayer 212 DO ig=1,ngrid 213 zcondicea(ig,l) = 0. 214 pduc(ig,l) = 0 215 pdvc(ig,l) = 0 216 pdqc(ig,l,i_co2ice) = 0 217 END DO 218 END DO 219 220 DO ig=1,ngrid 221 Mfallice(ig) = 0. 222 zfallice(ig) = 0. 223 zcondices(ig) = 0. 224 pdtsrfc(ig) = 0. 225 pdpsrf(ig) = 0. 226 condsub(ig) = .false. 227 pdqsurfc(ig) = 0. 228 ENDDO 229 230 !----------------------------------------------------------------------- 180 181 182 !------------------------------------------------ 183 ! Tendencies initially set to 0 184 !------------------------------------------------ 185 186 187 pdqc(1:ngrid,1:nlayer,1:nq) = 0. 188 pdtc(1:ngrid,1:nlayer) = 0. 189 zq(1:ngrid,1:nlayer,1:nq) = 0. 190 zt(1:ngrid,1:nlayer) = 0. 191 Mfallice(1:ngrid) = 0. 192 zfallice(1:ngrid) = 0. 193 zcondices(1:ngrid) = 0. 194 pdtsrfc(1:ngrid) = 0. 195 pdpsrfc(1:ngrid) = 0. 196 pdqsurfc(1:ngrid) = 0. 197 198 199 !---------------------------------- 231 200 ! Atmospheric condensation 201 !---------------------------------- 232 202 233 203 … … 238 208 ! DO ig=1,ngrid 239 209 ! qco2=pq(ig,l,ico2)+pdq(ig,l,ico2)*ptimestep 240 ! !Mean air molecular mass = 1/(q(ico2)/m_co2 + (1-q(ico2))/m_noco2)210 ! Mean air molecular mass = 1/(q(ico2)/m_co2 + (1-q(ico2))/m_noco2) 241 211 ! mmean=1/(A*qco2 +B) 242 212 ! vmr_co2(ig,l) = qco2*mmean/m_co2 … … 251 221 ! end if 252 222 253 ! Forecast the atmospheric frost temperature 'ztcond' and nucleation temperature 'ztnuc' 223 224 ! Forecast the atmospheric frost temperature 'ztcond' and nucleation temperature 'ztnuc'. 254 225 DO l=1,nlayer 255 226 DO ig=1,ngrid … … 260 231 ENDDO 261 232 262 ! Initialize zq and zt at the beginning of the sub-timestep loop 263 DO l=1,nlayer 264 DO ig=1,ngrid 233 ! Initialize zq and zt at the beginning of the sub-timestep loop and qsurf. 234 DO ig=1,ngrid 235 piceco2(ig)=pqsurf(ig,i_co2ice) 236 DO l=1,nlayer 265 237 zt(ig,l)=pt(ig,l) 266 238 zq(ig,l,i_co2ice)=pq(ig,l,i_co2ice) … … 274 246 ENDDO 275 247 276 !Calculate the mass of each atmospheric layer (kg.m-2)248 ! Calculate the mass of each atmospheric layer (kg.m-2) 277 249 do ilay=1,nlayer 278 250 DO ig=1,ngrid … … 281 253 end do 282 254 283 ! ----------------------------------------------- 255 256 !----------------------------------------------------------- 284 257 ! START CONDENSATION/SEDIMENTATION SUB-TIME LOOP 285 ! ----------------------------------------------- 286 Ntime = 20 ! number of sub-timestep 258 !----------------------------------------------------------- 259 260 261 Ntime = 20 ! number of sub-timestep 287 262 subptimestep = ptimestep/float(Ntime) 288 263 264 ! Add the tendencies from other physical processes at each subtimstep. 289 265 DO it=1,Ntime 290 291 ! Add the tendencies from other physical processes at each subtimstep292 266 DO l=1,nlayer 293 267 DO ig=1,ngrid … … 297 271 END DO 298 272 299 300 ! Gravitational sedimentation 273 ! Gravitational sedimentation starts. 301 274 302 ! sedimentation computed from radius computed from q in module radii_mod 275 ! Sedimentation computed from radius computed from q in module radii_mod. 303 276 call co2_reffrad(ngrid,nlayer,nq,zq,reffrad) 304 277 305 doilay=1,nlayer278 DO ilay=1,nlayer 306 279 DO ig=1,ngrid 307 280 … … 316 289 pplev(ig,ilay)/(r*pt(ig,ilay)) 317 290 318 end do 319 end do 320 321 ! Computing q after sedimentation 322 291 END DO 292 END DO 293 294 ! Computing q after sedimentation 323 295 call vlz_fi(ngrid,nlayer,zq(1,1,i_co2ice),2.,masse,w(1,1,i_co2ice),wq) 324 296 325 297 326 ! Progressively accumulating the flux to the ground 327 ! Mfallice is the total amount of ice fallen to the ground 298 ! Progressively accumulating the flux to the ground. 299 ! Mfallice is the total amount of ice fallen to the ground. 328 300 DO ig=1,ngrid 329 301 Mfallice(ig) = Mfallice(ig) + wq(ig,i_co2ice) 330 end do 331 332 333 ! Condensation / sublimation in the atmosphere 334 ! -------------------------------------------- 335 ! (calculation of zcondicea, zfallice and pdtc) 336 ! (MODIFICATIONS FOR EARLY MARS: falling heat neglected, condensation 337 ! of CO2 into tracer i_co2ice) 302 END DO 303 304 !---------------------------------------------------------- 305 ! Condensation / sublimation in the atmosphere 306 !---------------------------------------------------------- 307 ! (MODIFICATIONS FOR EARLY MARS: falling heat neglected, condensation of CO2 into tracer i_co2ice) 308 338 309 339 310 DO l=nlayer , 1, -1 … … 341 312 pdtc(ig,l)=0. 342 313 343 344 ! ztcond-> ztnuc in test beneath to nucleate only when super saturation occurs(JL 2011) 314 ! ztcond-> ztnuc in test beneath to nucleate only when super saturation occurs(JL 2011) 345 315 IF ((zt(ig,l).LT.ztnuc(ig,l)).or.(zq(ig,l,i_co2ice).gt.1.E-10)) THEN 346 condsub(ig)=.true.347 316 pdtc(ig,l) = (ztcond(ig,l) - zt(ig,l))/subptimestep 348 317 pdqc(ig,l,i_co2ice) = pdtc(ig,l)*ccond*g 349 318 350 !Case when the ice from above sublimes entirely319 ! Case when the ice from above sublimes entirely 351 320 IF ((zq(ig,l,i_co2ice).lt.-pdqc(ig,l,i_co2ice)*subptimestep) & 352 321 .AND. (zq(ig,l,i_co2ice).gt.0)) THEN … … 357 326 END IF 358 327 359 !Temperature and q after condensation328 ! Temperature and q after condensation 360 329 zt(ig,l) = zt(ig,l) + pdtc(ig,l) * subptimestep 361 330 zq(ig,l,i_co2ice) = zq(ig,l,i_co2ice) + pdqc(ig,l,i_co2ice) * subptimestep … … 364 333 ENDDO 365 334 ENDDO 366 ENDDO ! end of subtimestep loop 367 368 ! Computing global tendencies after the subtimestep 335 336 ENDDO! end of subtimestep loop. 337 338 ! Computing global tendencies after the subtimestep. 369 339 DO l=1,nlayer 370 340 DO ig=1,ngrid … … 381 351 382 352 !----------------------------------------------------------------------- 383 ! Condensation/sublimation on the ground 384 ! (calculation of zcondices and pdtsrfc) 385 386 ! forecast of ground temperature ztsrf and frost temperature ztcondsol 353 ! Condensation/sublimation on the ground 354 !----------------------------------------------------------------------- 355 356 357 ! Forecast of ground temperature ztsrf and frost temperature ztcondsol. 387 358 DO ig=1,ngrid 388 359 ppco2=gfrac(igas_CO2)*pplay(ig,1) … … 406 377 407 378 DO ig=1,ngrid 379 408 380 IF(ig.GT.ngrid/2+1) THEN 409 381 icap=2 … … 412 384 ENDIF 413 385 414 !Loop over where we have condensation / sublimation386 ! Loop over where we have condensation / sublimation 415 387 IF ((ztsrf(ig) .LT. ztcondsol(ig)) .OR. & ! ground condensation 416 388 (zfallice(ig).NE.0.) .OR. & ! falling snow 417 389 ((ztsrf(ig) .GT. ztcondsol(ig)) .AND. & ! ground sublimation 418 390 ((piceco2(ig)+zfallice(ig)*ptimestep) .NE. 0.))) THEN 419 condsub(ig) = .true. 420 421 !Condensation or partial sublimation of CO2 ice391 392 393 ! Condensation or partial sublimation of CO2 ice 422 394 zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) & 423 395 /(latcond*ptimestep) 424 396 pdtsrfc(ig) = (ztcondsol(ig) - ztsrf(ig))/ptimestep 425 397 426 !If the entire CO_2 ice layer sublimes427 !(including what has just condensed in the atmosphere)398 ! If the entire CO_2 ice layer sublimes 399 ! (including what has just condensed in the atmosphere) 428 400 IF((piceco2(ig)/ptimestep+zfallice(ig)).LE. & 429 401 -zcondices(ig))THEN … … 433 405 END IF 434 406 435 ! Changing CO2 ice amount and pressure 436 437 pdqsurfc(ig) = zcondices(ig) + zfallice(ig) 438 piceco2(ig) = piceco2(ig) + pdqsurfc(ig)*ptimestep 439 pdpsrf(ig) = -pdqsurfc(ig)*g 440 441 IF(ABS(pdpsrf(ig)*ptimestep).GT.pplev(ig,1)) THEN 407 ! Changing CO2 ice amount and pressure 408 piceco2(ig) = piceco2(ig) + pdqsurfc(ig)*ptimestep 409 pdqsurfc(ig) = zcondices(ig) + zfallice(ig) 410 pdpsrfc(ig) = -pdqsurfc(ig)*g 411 412 IF(ABS(pdpsrfc(ig)*ptimestep).GT.pplev(ig,1)) THEN 442 413 PRINT*,'STOP in condens' 443 414 PRINT*,'condensing more than total mass' 444 415 PRINT*,'Grid point ',ig 445 416 PRINT*,'Ps = ',pplev(ig,1) 446 PRINT*,'d Ps = ',pdpsrf (ig)417 PRINT*,'d Ps = ',pdpsrfc(ig) 447 418 STOP 448 419 ENDIF 449 420 END IF 450 ENDDO 451 421 422 ENDDO ! end of ngrid loop. 423 424 425 !--------------------------------------------------------------------------------------------- 452 426 ! Surface albedo and emissivity of the ground below the snow (emisref) 453 ! -------------------------------------------------------------------- 427 !--------------------------------------------------------------------------------------------- 428 429 454 430 DO ig=1,ngrid 431 455 432 IF(lati(ig).LT.0.) THEN 456 433 icap=2 ! Southern Hemisphere … … 477 454 end if 478 455 479 piceco2(ig) = piceco2(ig) - pdqsurfc(ig)*ptimestep ! This line was added so that tendencies are added outside the routine. MT2015. 480 if(.not.piceco2(ig).ge.0.) THEN 481 if(piceco2(ig).le.-1.e-8) print*, & 482 'WARNING 2 : in condense_co2cloud: piceco2(',ig,')=', piceco2(ig) 483 piceco2(ig)=0. 484 endif 485 486 end do 456 END DO 487 457 488 458 return 489 end subroutine condense_co2 490 491 !------------------------------------------------------------------------- 492 subroutine get_tcond_co2(p,tcond) 493 ! Calculates the condensation temperature for CO2 459 460 end subroutine condense_co2 461 462 463 464 !------------------------------------------------------------------------- 465 !------------------------------------------------------------------------- 466 !------------------------------------------------------------------------- 467 !------------------------------------------------------------------------- 468 !------------------------------------------------------------------------- 469 !------------------------------------------------------------------------- 470 471 472 473 subroutine get_tcond_co2(p,tcond) ! Calculates the condensation temperature for CO2 474 494 475 495 476 implicit none … … 500 481 peff=p 501 482 502 if(peff.lt.ptriple) then503 tcond = (-3167.8)/(log(.01*peff)-23.23) ! Fanale's formula 483 if(peff.lt.ptriple) then 484 tcond = (-3167.8)/(log(.01*peff)-23.23) ! Fanale's formula. 504 485 else 505 tcond = 684.2-92.3*log(peff)+4.32*log(peff)**2 506 ! liquid-vapour transition (based on CRC handbook 2003 data) 486 tcond = 684.2-92.3*log(peff)+4.32*log(peff)**2 ! liquid-vapour transition (based on CRC handbook 2003 data) 507 487 endif 508 488 return 509 489 510 end subroutine get_tcond_co2 511 512 513 514 515 !------------------------------------------------------------------------- 516 subroutine get_tnuc_co2(p,tnuc) 517 ! Calculates the nucleation temperature for CO2, based on a simple super saturation criterion 518 ! (JL 2011) 490 end subroutine get_tcond_co2 491 492 493 494 !------------------------------------------------------------------------- 495 !------------------------------------------------------------------------- 496 !------------------------------------------------------------------------- 497 !------------------------------------------------------------------------- 498 !------------------------------------------------------------------------- 499 !------------------------------------------------------------------------- 500 501 502 503 subroutine get_tnuc_co2(p,tnuc) 504 ! Calculates the nucleation temperature for CO2, based on a simple super saturation criterion. JL 2011. 519 505 520 506 use callkeys_mod, only: co2supsat … … 527 513 peff=p/co2supsat 528 514 529 if(peff.lt.ptriple) then515 if(peff.lt.ptriple) then 530 516 tnuc = (-3167.8)/(log(.01*peff)-23.23) ! Fanale's formula 531 517 else … … 533 519 ! liquid-vapour transition (based on CRC handbook 2003 data) 534 520 endif 521 535 522 return 536 523 537 end subroutine get_tnuc_co2524 end subroutine get_tnuc_co2 -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r1484 r1485 299 299 300 300 ! For Winds : (m/s/s) 301 real zdvc(ngrid,nlayer),zduc(ngrid,nlayer) ! Condense_co2 routine.302 301 real zdvadj(ngrid,nlayer),zduadj(ngrid,nlayer) ! Convadj routine. 303 302 real zdumr(ngrid,nlayer),zdvmr(ngrid,nlayer) ! Mass_redistribution routine. … … 1199 1198 call condense_co2(ngrid,nlayer,nq,ptimestep, & 1200 1199 capcal,pplay,pplev,tsurf,pt, & 1201 pphi,pdt,pdu,pdv,zdtsurf,pu,pv,pq,pdq, & 1202 qsurf(1:ngrid,igcm_co2_ice),zdqsurfc, & 1203 albedo,emis, & 1200 pdt,zdtsurf,pq,pdq, & 1201 qsurf,zdqsurfc,albedo,emis, & 1204 1202 albedo_bareground,albedo_co2_ice_SPECTV, & 1205 zdtc,zdtsurfc,pdpsrf,zduc,zdvc, & 1206 zdqc) 1203 zdtc,zdtsurfc,pdpsrf,zdqc) 1207 1204 1208 1205 pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+zdtc(1:ngrid,1:nlayer) 1209 pdv(1:ngrid,1:nlayer) = pdv(1:ngrid,1:nlayer)+zdvc(1:ngrid,1:nlayer)1210 pdu(1:ngrid,1:nlayer) = pdu(1:ngrid,1:nlayer)+zduc(1:ngrid,1:nlayer)1211 1206 zdtsurf(1:ngrid) = zdtsurf(1:ngrid) + zdtsurfc(1:ngrid) 1212 1207
Note: See TracChangeset
for help on using the changeset viewer.