Changeset 2823 for trunk/LMDZ.MARS
- Timestamp:
- Nov 18, 2022, 10:43:43 AM (2 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r2819 r2823 3783 3783 - Now allow seasonal frost to change albedo in 1d 3784 3784 - Can now output albedo in 1d with diagfi.def 3785 3786 == 18/11/2022 == EM 3787 Remove the "tracer" (logical) flag as we now always run with at least 3788 one tracer. -
trunk/LMDZ.MARS/libf/aeronomars/thermosphere.F
r2615 r2823 10 10 implicit none 11 11 12 #include "callkeys.h"12 include "callkeys.h" 13 13 14 14 integer,intent(in) :: ngrid ! number of atmospheric columns … … 43 43 44 44 if (firstcall) then 45 if (.not. tracer) then 46 do l=1,nlayer 47 do ig=1,ngrid 48 rnew(ig,l)=r 49 cpnew(ig,l)=cpp 50 enddo 51 enddo 52 endif 45 rnew(1:ngrid,1:nlayer)=r 46 cpnew(1:ngrid,1:nlayer)=cpp 53 47 firstcall= .false. 54 48 endif -
trunk/LMDZ.MARS/libf/phymars/callkeys.h
r2628 r2823 10 10 & ,callnirco2,callnlte,callthermos,callconduct,calleuv & 11 11 & ,callmolvis,callmoldiff,thermochem,thermoswater,callemis & 12 & ,callg2d,linear,rayleigh ,tracer&12 & ,callg2d,linear,rayleigh & 13 13 & ,scavenging,sedimentation & 14 14 & ,activice,water,tifeedback,microphys,supersat,caps,photochem & … … 69 69 70 70 logical rayleigh 71 logical tracer72 71 logical scavenging 73 72 logical rdstorm ! rocket dust storm parametrization -
trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90
r1226 r2823 36 36 ! ----------------------------------------------------------------------- 37 37 38 SUBROUTINE calltherm_interface (ngrid,nlayer,nq, & 39 & tracer,igcm_co2, & 38 SUBROUTINE calltherm_interface (ngrid,nlayer,nq, igcm_co2, & 40 39 & zzlev,zzlay, & 41 40 & ptimestep,pu,pv,pt,pq,pdu,pdv,pdt,pdq,q2, & … … 71 70 REAL, INTENT(IN) :: zzlay(ngrid,nlayer) ! altitude at the middle of the layers 72 71 REAL, INTENT(IN) :: zzlev(ngrid,nlayer+1) ! altitude at layer boundaries 73 LOGICAL, INTENT(IN) :: tracer ! =.true. if tracers are present and to be transported74 72 INTEGER, INTENT(IN) :: igcm_co2 ! index of the CO2 tracer in mixing ratio array 75 73 ! --> 0 if no tracer is CO2 (or no tracer at all) … … 168 166 fraca(:,:)=0. 169 167 zfraca(:,:)=0. 170 if (tracer) then 171 pdq_th(:,:,:)=0. 172 end if 168 pdq_th(:,:,:)=0. 173 169 d_t_ajs(:,:)=0. 174 170 d_u_ajs(:,:)=0. … … 195 191 196 192 if(qtransport_thermals) then 197 if(tracer) then ! tracer is a logical that is true if tracer must be transported in the GCM physics 198 pq_therm(:,:,:)=pq(:,:,:)+pdq(:,:,:)*ptimestep ! tracer concentration 199 endif 193 pq_therm(:,:,:)=pq(:,:,:)+pdq(:,:,:)*ptimestep ! tracer concentration 200 194 endif 201 195 … … 228 222 ! CALL to main thermal routine 229 223 CALL thermcell_main_mars(ngrid,nlayer,nq & 230 & , tracer,igcm_co2 &224 & ,igcm_co2 & 231 225 & ,zdt & 232 226 & ,pplay,pplev,pphi,zzlev,zzlay & … … 366 360 ! if tracers are transported in thermals, update output variables, else these are 0. 367 361 if(qtransport_thermals) then 368 if(tracer) then369 362 do iq=1,nq 370 363 if (iq .ne. igcm_co2) then … … 378 371 endif 379 372 enddo 380 endif381 373 endif 382 374 -
trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F
r2739 r2823 190 190 ico2=0 191 191 192 if (tracer) then 193 c Prepare Special treatment if one of the tracer is CO2 gas 194 do iq=1,nq 192 c Prepare Special treatment if one of the tracer is CO2 gas 193 do iq=1,nq 195 194 if (noms(iq).eq."co2") then 196 195 ico2=iq … … 204 203 B=1/m_noco2 205 204 endif 206 enddo 207 end if 205 enddo 208 206 ENDIF ! of IF (firstcall) 209 207 zcpi=1./cpp -
trunk/LMDZ.MARS/libf/phymars/conf_phys.F
r2661 r2823 106 106 write(*,*) "startphy_file", startphy_file 107 107 108 write(*,*) "Run with or without tracer transport ?"109 tracer=.false. ! default value110 call getin_p("tracer",tracer)111 write(*,*) " tracer = ",tracer112 113 108 write(*,*) "Diurnal cycle ?" 114 109 write(*,*) "(if diurnal=False, diurnal averaged solar heating)" … … 672 667 endif 673 668 674 if (water.and..not.tracer) then675 print*,'if water is used, tracer should be used too'676 call abort_physic(modname,677 & "water requires tracer",1)678 endif679 680 669 if (hdo.and..not.water) then 681 670 print*,'if hdo is used, water should be used too' -
trunk/LMDZ.MARS/libf/phymars/convadj.F
r2586 r2823 96 96 97 97 ico2=0 98 if (tracer) then99 98 ! Prepare Special treatment if one of the tracers is CO2 gas 100 99 do iq=1,nq … … 111 110 end if 112 111 enddo 113 endif114 112 firstcall=.false. 115 113 ENDIF ! of IF (firstcall) … … 123 121 ENDDO 124 122 125 if(tracer) then 126 DO iq =1, nq 127 DO l=1,nlay 128 DO ig=1,ngrid 129 zq(ig,l,iq)=pq(ig,l,iq)+pdqfi(ig,l,iq)*ptimestep 130 ENDDO 131 ENDDO 132 ENDDO 133 end if 123 zq(1:ngrid,1:nlay,1:nq)=pq(1:ngrid,1:nlay,1:nq)+ 124 & pdqfi(1:ngrid,1:nlay,1:nq)*ptimestep 134 125 135 126 zh2(:,:)=zh(:,:) … … 393 384 ENDDO 394 385 395 if(tracer) then 396 do iq=1, nq 397 do l=1,nlay 398 do ig=1, ngrid 399 pdqadj(ig,l,iq)=(zq2(ig,l,iq)-zq(ig,l,iq))/ptimestep 400 end do 401 end do 402 end do 403 end if 404 405 406 ! output 407 ! if (ngrid.eq.1) then 408 ! ig=1 409 ! iq =1 410 ! write(*,*)'**convadj: l, pq(ig,l,iq),zq(ig,l,iq),zq2(ig,l,iq)' 411 ! do l=nlay,1,-1 412 ! write(*,*) l, pq(ig,l,iq),zq(ig,l,iq),zq2(ig,l,iq) 413 ! end do 414 ! end if 415 416 417 return 386 pdqadj(1:ngrid,1:nlay,1:nq)=(zq2(1:ngrid,1:nlay,1:nq) 387 & -zq(1:ngrid,1:nlay,1:nq))/ptimestep 388 418 389 end 419 390 -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
r2790 r2823 221 221 endif 222 222 223 ! check if we are going to run with or without tracers 224 write(*,*) "Run with or without tracer transport ?" 225 tracer=.false. ! default value 226 call getin("tracer",tracer) 227 write(*,*) " tracer = ",tracer 228 229 ! while we're at it, check if there is a 'traceur.def' file 223 224 ! check if there is a 'traceur.def' file 230 225 ! and process it. 231 if (tracer) then232 226 ! load tracer names from file 'traceur.def' 233 227 open(90,file='traceur.def',status='old',form='formatted', … … 246 240 write(*,*) "testphys1d: error reading number of tracers" 247 241 write(*,*) " (first line of traceur.def) " 242 stop 243 endif 244 if (nq<1) then 245 write(*,*) "testphys1d: error number of tracers" 246 write(*,*) "is nq=",nq," but must be >=1!" 248 247 stop 249 248 endif … … 318 317 write(*,*) "testphys1d: initializing tracers" 319 318 call read_profile(nq, nlayer, qsurf, q) 320 else321 ! we still need to set (dummy) tracer number and names for physdem1322 nq=1323 nqtot=nq ! set value of nqtot (in infotrac module) as nq324 ! allocate arrays:325 allocate(tname(nq))326 allocate(q(nlayer,nq))327 allocate(qsurf(nq))328 allocate(dq(nlayer,nq))329 allocate(dqdyn(nlayer,nq))330 allocate(mqtot(nq))331 do iq=1,nq332 write(str7,'(a1,i2.2)')'t',iq333 tname(iq)=str7334 enddo335 ! and just to be clean, also initialize tracers to zero for physdem1336 q(:,:)=0337 qsurf(:)=0338 endif ! of if (tracer)339 340 !write(*,*) "testphys1d q", q(1,:)341 !write(*,*) "testphys1d qsurf", qsurf342 319 343 320 c Date and local time at beginning of run -
trunk/LMDZ.MARS/libf/phymars/initracer.F
r2659 r2823 51 51 c----------------------------------------------------------------------- 52 52 53 53 ! Sanity check: check that we are running with at least 1 tracer: 54 if (nq<1) then 55 write(*,*) "initracer error, nq=",nq," must be >=1!" 56 call abort_physic("initracer","nq<1",1) 57 endif 54 58 c------------------------------------------------------------ 55 59 c NAME and molar mass of the tracer -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r2819 r2823 640 640 c initialize tracers 641 641 c ~~~~~~~~~~~~~~~~~~ 642 IF (tracer) THEN 643 CALL initracer(ngrid,nq,qsurf) 644 ENDIF ! end tracer 642 CALL initracer(ngrid,nq,qsurf) 645 643 646 644 c Initialize albedo and orbital calculation … … 698 696 699 697 700 IF ( tracer.AND.water.AND.(ngrid.NE.1)) THEN698 IF (water.AND.(ngrid.NE.1)) THEN 701 699 write(*,*)"physiq: water_param Surface water frost albedo:", 702 700 . albedo_h2o_frost … … 1389 1387 ENDDO 1390 1388 1391 if (tracer) then1392 1389 DO iq=1, nq 1393 1390 DO l=1,nlayer … … 1402 1399 ENDDO 1403 1400 ENDDO 1404 end if ! of if (tracer) 1401 1405 1402 ELSE 1406 1403 write (*,*) '******************************************' … … 1449 1446 if(calltherm .and. .not.turb_resolved) then 1450 1447 1451 call calltherm_interface(ngrid,nlayer,nq, 1452 $ tracer,igcm_co2, 1448 call calltherm_interface(ngrid,nlayer,nq,igcm_co2, 1453 1449 $ zzlev,zzlay, 1454 1450 $ ptimestep,pu,pv,pt,pq,pdu,pdv,pdt,pdq,q2, … … 1470 1466 ENDDO 1471 1467 1472 if (tracer) then1473 1468 DO iq=1,nq 1474 1469 DO l=1,nlayer … … 1478 1473 ENDDO 1479 1474 ENDDO 1480 endif1481 1475 1482 1476 lmax_th_out(:)=real(lmax_th(:)) … … 1521 1515 ENDDO 1522 1516 1523 if(tracer) then1524 1517 DO iq=1, nq 1525 1518 DO l=1,nlayer … … 1529 1522 ENDDO 1530 1523 ENDDO 1531 end if1532 1524 ENDIF ! of IF(calladj) 1533 1525 … … 1561 1553 c: ----------------------------------------- 1562 1554 1563 if (tracer) then1564 1555 1565 1556 c 9a. Water and ice … … 1995 1986 #endif 1996 1987 1997 endif ! of if (tracer)1998 1988 1999 1989 #ifndef MESOSCALE … … 2066 2056 ENDDO 2067 2057 2068 IF (tracer) THEN2069 2058 DO iq=1, nq 2070 2059 DO l=1,nlayer … … 2074 2063 ENDDO 2075 2064 ENDDO 2076 ENDIF ! of IF (tracer)2077 2065 2078 2066 #ifndef MESOSCALE … … 2103 2091 c Updating tracer budget on surface 2104 2092 c----------------------------------------------------------------------- 2105 IF (tracer) THEN2106 2093 DO iq=1, nq 2107 2094 DO ig=1,ngrid … … 2111 2098 ENDDO ! (ig) 2112 2099 ENDDO ! (iq) 2113 ENDIF2114 2100 c----------------------------------------------------------------------- 2115 2101 c 12. Surface and sub-surface soil temperature … … 2129 2115 2130 2116 2131 IF ( tracer.AND.water) THEN2117 IF (water) THEN 2132 2118 !#ifndef MESOSCALE 2133 2119 ! if (caps.and.(obliquit.lt.27.)) then => now done in co2condens … … 2160 2146 endif 2161 2147 enddo ! of do ig=1,ngrid 2162 ENDIF ! of IF ( tracer.AND.water.AND.(ngrid.NE.1))2148 ENDIF ! of IF (water) 2163 2149 2164 2150 c … … 2472 2458 enddo 2473 2459 2474 if (tracer) then2475 2460 ! Density-scaled opacities 2476 2461 do ig=1,ngrid … … 2645 2630 end do 2646 2631 end if 2647 endif ! of if (tracer) 2632 2648 2633 #ifndef MESOSCALE 2649 2634 c ----------------------------------------------------------------- … … 2717 2702 endif 2718 2703 2719 if (tracer) then2720 2704 if (water) then 2721 2705 vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap) … … 2911 2895 end if ! of if (photochem) 2912 2896 2913 end if ! of if (tracer)2914 2897 2915 2898 IF(lastcall.and.callstats) THEN … … 3073 3056 c ---------------------------------------------------------- 3074 3057 3075 if ( tracer.and.(igcm_co2.ne.0)) then3058 if (igcm_co2.ne.0) then 3076 3059 call WRITEDIAGFI(ngrid,"co2","co2 mass mixing ratio", 3077 3060 & "kg.kg-1",3,zq(:,:,igcm_co2)) … … 3091 3074 call WRITEDIAGFI(ngrid,"icetotco2","total mass atm of co2 ice", 3092 3075 & "kg.m-2", 2, icetotco2) 3093 call WRITEDIAGFI(ngrid,"vaptotco2","total mass atm of co2 3094 & vapor","kg.m-2", 2, vaptotco2)3076 call WRITEDIAGFI(ngrid,"vaptotco2","total mass atm of co2 "// 3077 & "vapor","kg.m-2", 2, vaptotco2) 3095 3078 call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2, 3096 3079 & emis) … … 3117 3100 3118 3101 end if ! of if (co2clouds) 3119 end if ! of if ( tracer.and.(igcm_co2.ne.0))3102 end if ! of if (igcm_co2.ne.0) 3120 3103 3121 3104 ! Output He tracer, if there is one 3122 if ( tracer.and.(igcm_he.ne.0)) then3105 if (igcm_he.ne.0) then 3123 3106 call WRITEDIAGFI(ngrid,"he","helium mass mixing ratio", 3124 3107 & "kg/kg",3,zq(1,1,igcm_he)) … … 3132 3115 c Outputs of the water cycle 3133 3116 c ---------------------------------------------------------- 3134 if (tracer) then3135 3117 if (water) then 3136 3118 #ifdef MESOINI … … 3294 3276 c & 'kg/kg',3,zdqc(1,1,iq)) 3295 3277 end if !(water.and..not.photochem) 3296 end if !tracer3297 3278 3298 3279 c ---------------------------------------------------------- … … 3314 3295 endif 3315 3296 3316 if ( tracer.and.(dustbin.ne.0)) then3297 if (dustbin.ne.0) then 3317 3298 3318 3299 call WRITEDIAGFI(ngrid,'tau','taudust','SI',2,tau(1,1)) … … 3503 3484 #endif 3504 3485 3505 end if ! ( tracer.and.(dustbin.ne.0))3486 end if ! (dustbin.ne.0) 3506 3487 3507 3488 c ---------------------------------------------------------- … … 3582 3563 ! & 'tendance v thermiques','m/s', 3583 3564 ! & 3,pdv_th*ptimestep) 3584 ! if (tracer) then3585 3565 ! if (nq .eq. 2) then 3586 3566 ! call WRITEDIAGFI(ngrid,'deltaq_th', … … 3588 3568 ! & 3,ptimestep*pdq_th(:,:,2)) 3589 3569 ! end if 3590 ! end if3591 3570 3592 3571 call WRITEDIAGFI(ngrid,'zmax_th', … … 3702 3681 c & 'K JA2',1,pt) 3703 3682 3704 if(tracer) then3705 3683 c CALL writeg1d(ngrid,1,tau,'tau','SI') 3706 3684 do iq=1,nq … … 3772 3750 & 'J.s-1/2.m-2.K-1',1,inertiesoil) 3773 3751 endif 3774 end if3775 3752 3776 3753 cccccccccccccccccc scavenging & water outputs 1D TN ccccccccccccccc … … 4061 4038 ! endif 4062 4039 !CREATE IF CO2CYCLE 4063 ! if ( tracer.and.(igcm_co2.ne.0)) then4040 ! if (igcm_co2.ne.0) then 4064 4041 ! CALL send_xios_field("co2",zq(:,:,igcm_co2)) 4065 4042 ! endif -
trunk/LMDZ.MARS/libf/phymars/thermcell_main_mars.F90
r2616 r2823 31 31 ! ----------------------------------------------------------------------- 32 32 33 SUBROUTINE thermcell_main_mars(ngrid,nlayer,nq & 34 & ,tracer,igcm_co2 & 33 SUBROUTINE thermcell_main_mars(ngrid,nlayer,nq,igcm_co2 & 35 34 & ,ptimestep & 36 35 & ,pplay,pplev,pphi,zlev,zlay & … … 61 60 INTEGER, INTENT(IN) :: nlayer ! number of vertical grid points 62 61 INTEGER, INTENT(IN) :: nq ! number of tracer species 63 LOGICAL, INTENT(IN) :: tracer ! =.true. if tracers are present and to be transported64 62 INTEGER, INTENT(IN) :: igcm_co2 ! index of the CO2 tracer in mixing ratio array 65 63 ! --> 0 if no tracer is CO2 (or no tracer at all) -
trunk/LMDZ.MARS/libf/phymars/vdif_kc.F
r2616 r2823 4 4 use tracer_mod, only: noms 5 5 IMPLICIT NONE 6 c....................................................................... 7 #include "callkeys.h" 6 8 7 c....................................................................... 9 8 c … … 232 231 if(firstcall) then 233 232 ico2=0 234 if (tracer) then235 233 ! Prepare Special treatment if one of the tracers is CO2 gas 236 234 do iq=1,nq … … 247 245 end if 248 246 enddo 249 endif250 247 251 248 firstcall=.false. -
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r2616 r2823 211 211 ico2=0 212 212 213 if (tracer) then214 213 c Prepare Special treatment if one of the tracer is CO2 gas 215 214 do iq=1,nq … … 226 225 endif 227 226 enddo 228 end if229 227 230 228 firstcall=.false. … … 351 349 ENDDO 352 350 ENDDO 353 if(tracer) then 354 DO iq =1, nq 355 DO ilev=1,nlay 356 DO ig=1,ngrid 357 zq(ig,ilev,iq)=pq(ig,ilev,iq)+pdqfi(ig,ilev,iq)*ptimestep 358 ENDDO 359 ENDDO 360 ENDDO 361 end if 351 zq(1:ngrid,1:nlay,1:nq)=pq(1:ngrid,1:nlay,1:nq)+ 352 & pdqfi(1:ngrid,1:nlay,1:nq)*ptimestep 362 353 363 354 c----------------------------------------------------------------------- … … 705 696 c TRACERS 706 697 c ------- 707 708 if(tracer) then709 698 710 699 c Using the wind modified by friction for lifting and sublimation … … 1056 1045 1057 1046 enddo ! of do iq=1,nq 1058 end if ! of if(tracer)1059 1047 1060 1048 c --------- end of tracers ---------------------------- … … 1087 1075 ENDDO 1088 1076 1089 if (tracer) then 1090 DO iq = 1, nq 1091 DO ilev = 1, nlay 1092 DO ig=1,ngrid 1093 pdqdif(ig,ilev,iq)=(zq(ig,ilev,iq)- 1094 $ (pq(ig,ilev,iq) + pdqfi(ig,ilev,iq)*ptimestep))/ptimestep 1095 ENDDO 1096 ENDDO 1097 ENDDO 1098 end if 1077 pdqdif(1:ngrid,1:nlay,1:nq)=(zq(1:ngrid,1:nlay,1:nq)- 1078 & (pq(1:ngrid,1:nlay,1:nq) 1079 & +pdqfi(1:ngrid,1:nlay,1:nq) 1080 & *ptimestep))/ptimestep 1099 1081 1100 1082 c ** diagnostique final -
trunk/LMDZ.MARS/libf/phymars/yamada4.F
r2616 r2823 14 14 use turb_mod, only: l0 15 15 IMPLICIT NONE 16 !....................................................................... 17 ! MARS 18 include "callkeys.h" 16 19 17 !....................................................................... 20 18 ! … … 147 145 if(firstcall) then 148 146 ico2=0 149 if (tracer) then150 147 ! Prepare Special treatment if one of the tracers is CO2 gas 151 148 do iq=1,nq … … 162 159 end if 163 160 enddo 164 endif165 161 firstcall=.false. 166 162 endif !of if firstcall
Note: See TracChangeset
for help on using the changeset viewer.