Changeset 2872


Ignore:
Timestamp:
Jan 16, 2023, 4:47:12 PM (23 months ago)
Author:
jleconte
Message:

Cleaning up in interface v4

Location:
trunk/WRF.COMMON/INTERFACES_V4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_generic_lmd/update_inputs_physiq_mod.F

    r2868 r2872  
    2626  REAL,INTENT(OUT) :: MY
    2727  REAL :: sec,nsec
    28  
     28  print*,'GMT, elaps/3600=',GMT,elaps/3600.
    2929  !IF (JULYR .le. 8999) THEN
    30   !  if (tlocked .eqv. .false.) THEN
     30    if (tlocked .eqv. .false.) THEN
    3131      JH_cur_split = (GMT + elaps/3600.) !! universal time (0<JH_cur_split<1): JH_cur_split=0.5 at 12:00 UT
    3232      JH_cur_split = MODULO(JH_cur_split,24.)   !! the two arguments of MODULO must be of the same type
     
    5151  !    !ptime = lct_input - lon_input / 15. + elaps/3600.
    5252  !    !pday =  INT((3600*(lct_input - lon_input / 15.) + elaps)/86400)
    53   !  ELSE
    54   !    JH_cur_split = lct_input - lon_input / 15. !+ elaps/1500.0
     53  ELSE
     54       JH_cur_split = 0.
     55       JD_cur = 0.
    5556  !    !pday =  INT((sec*(lct_input - lon_input / 15.)+ elaps)/36000)
    5657  !    JD_cur =  INT((sec*(lct_input - lon_input / 15.))/3600)
     
    6364  !    MY = 2024
    6465  !  ENDIF
    65   !ENDIF
     66  ENDIF
    6667
    6768
     
    8687    noms(1)="h2o_vap"
    8788    noms(2)="h2o_ice"
    88   else if (TRACER_MODE .eq. 22)  then
    89     nqtot=2
    90     IF (.not.ALLOCATED(noms)) ALLOCATE(noms(nqtot)) !! est fait dans initracer normalement
    91     noms(1)="co2_vap"
    92     noms(2)="co2_ice"
    9389  else
    9490    nq=1
     
    325321     SELECT CASE (TRACER_MODE)
    326322       CASE(1)
    327        qsurf(subs,2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
     323         qsurf(subs,2)=M_H2OICE(i,j)  !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
    328324                                      !! ----- retrocompatible ancienne physique
    329325                                      !! ----- [H2O ice is last tracer in qsurf in LMD physics]
    330        CASE(2)   
    331        qsurf(subs,1)=0.                !! not coupled with lifting for the moment [non remobilise]
    332        !CASE(3)
    333        !qsurf(subs,1)=q_prof(1,1)                !!! temporaire, a definir       
    334        !qsurf(subs,2)=q_prof(1,2)     
    335        CASE(11)
    336        qsurf(subs,2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
    337        qsurf(subs,3)=0.                !! not coupled with lifting for the moment [non remobilise]
    338        CASE(12)
    339        qsurf(subs,2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
    340        qsurf(subs,3)=0.                !! not coupled with lifting for the moment [non remobilise]
    341326     END SELECT
    342327
  • trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_generic_lmd/update_outputs_physiq_mod.F

    r2868 r2872  
    156156            ims,ime,jms,jme,kms,kme,&
    157157            ips,ipe,jps,jpe,kps,kpe,&
    158             SWDOWNZ,TAU_DUST,QSURFDUST,&
    159             MTOT,ICETOT,TAU_ICE,&
    160             HR_SW,HR_LW,HR_DYN,DT,DT_RAD,&
    161             RDUST,VMR_ICE,RICE,&
     158            HR_SW,HR_LW,HR_DYN,DT_RAD,&
    162159            CLOUDFRAC,TOTCLOUDFRAC,RH,&
    163160            DQICE,DQVAP,REEVAP,SURFRAIN,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
     
    169166   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,kps,kpe
    170167   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: &
    171      SWDOWNZ,TAU_DUST,QSURFDUST,&
    172      MTOT,ICETOT,TAU_ICE,&
    173168     TOTCLOUDFRAC,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
    174169     FLUXSURF_LW,FLXGRD,LATENT_HF,REEVAP,SURFRAIN
    175170   REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: &
    176      HR_SW,HR_LW,RDUST,VMR_ICE,RICE,CLOUDFRAC,HR_DYN,DT,DT_RAD,RH,DQICE,DQVAP,&
     171     HR_SW,HR_LW,CLOUDFRAC,HR_DYN,DT_RAD,RH,DQICE,DQVAP,&
    177172     DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF
    178173   INTEGER :: i,j,subs
  • trunk/WRF.COMMON/INTERFACES_V4/module_lmd_driver.F

    r2869 r2872  
    4242        CST_AL, CST_TI, &
    4343        isfflx, diff_opt, km_opt, &
    44         HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,&
     44        HR_SW,HR_LW,HR_DYN,DT_RAD,&
    4545        CLOUDFRAC,TOTCLOUDFRAC,RH, &
    4646        DQICE,DQVAP,REEVAP,SURFRAIN,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
    47         FLUXSURF_LW,FLXGRD,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF,LATENT_HF,SWDOWNZ,&
    48         TAU_DUST,RDUST,QSURFDUST,&
    49         MTOT,ICETOT,VMR_ICE,TAU_ICE,RICE,&
     47        FLUXSURF_LW,FLXGRD,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF,LATENT_HF,&
    5048        HFMAX,ZMAX,&
    5149        USTM,HFX,&
     
    106104     PSFC,TSK
    107105REAL, DIMENSION( ims:ime, jms:jme ), INTENT(OUT) :: &
    108      SWDOWNZ,&
    109      TAU_DUST,QSURFDUST,&
    110      MTOT,ICETOT,TAU_ICE,&
    111106     HFMAX,ZMAX,&
    112107     USTM,HFX,TOTCLOUDFRAC,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
     
    118113REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(OUT ) :: &
    119114     RTHPLATEN,RUPLATEN,RVPLATEN, &
    120      HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,RDUST,VMR_ICE,RICE,&
     115     HR_SW,HR_LW,HR_DYN,DT_RAD,&
    121116     CLOUDFRAC,RH,DQICE,DQVAP,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF
    122117REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: &
     
    440435! specific treatment for tracers !
    441436!--------------------------------!
    442 IF (TRACER_MODE .EQ. 0) THEN
    443     q_prof(:,1)=0.95
    444 ELSE IF (TRACER_MODE .GE. 1) THEN
     437IF (TRACER_MODE == 1) THEN
    445438    ! to be clean we should have an automatized process that makes sure that moist is sent to igcm_h2o_vap and etc.
    446439    q_prof(:,1) = SCALAR(i,kps:kpe,j,P_QH2O) / (1.d0 + SCALAR(i,kps:kpe,j,P_QH2O)) !! P_xxx is the index for variable xxx.
    447440    q_prof(:,2) = SCALAR(i,kps:kpe,j,P_QH2O_ICE) / (1.d0 + SCALAR(i,kps:kpe,j,P_QH2O))
    448441    ! conversion from mass mixing ratio in WRF to specific concentration in Physiq
    449 ELSE IF (TRACER_MODE .GE. 42) THEN
     442ELSE IF ((TRACER_MODE == 42).OR.(TRACER_MODE == 43)) THEN
     443    ! to be clean we should have an automatized process that makes sure that moist is sent to igcm_h2o_vap and etc.
     444    q_prof(:,1) = moist(i,kps:kpe,j,P_QV) / (1.d0 + moist(i,kps:kpe,j,P_QV)) !! P_xxx is the index for variable xxx.
     445    q_prof(:,2) = moist(i,kps:kpe,j,P_QC) / (1.d0 + moist(i,kps:kpe,j,P_QV))
     446    ! conversion from mass mixing ratio in WRF to specific concentration in Physiq
     447ELSE IF ((TRACER_MODE == 44).OR.(TRACER_MODE == 45)) THEN
    450448    ! to be clean we should have an automatized process that makes sure that moist is sent to igcm_h2o_vap and etc.
    451449    q_prof(:,1) = moist(i,kps:kpe,j,P_QV) / (1.d0 + moist(i,kps:kpe,j,P_QV)) !! P_xxx is the index for variable xxx.
     
    455453    q_prof(:,1:nq) = SCALAR(i,kps:kpe,j,2:nq+1)  !! the names were set above !! one dummy tracer in WRF
    456454    !JL22 cannot normalize to moist here as we do not know if it has been initialized.
    457 ENDIF
    458 
    459 IF (TRACER_MODE .EQ. 20) THEN
    460   IF (firstcall .EQV. .true. .and. (.not. restart)) THEN
    461       q_prof(:,:) = 0.95
    462   ENDIF
    463 ENDIF
    464 
    465 IF (TRACER_MODE .EQ. 32) THEN
    466   IF (firstcall .EQV. .true. .and. (.not. restart)) THEN
    467       q_prof(:,7) = 0.95
    468 !! traceurs(7)   = 'co2'
    469   ENDIF
    470455ENDIF
    471456
     
    667652            ims,ime,jms,jme,kms,kme,&
    668653            ips,ipe,jps,jpe,kps,kpe,&
    669             SWDOWNZ,TAU_DUST,QSURFDUST,&
    670             MTOT,ICETOT,TAU_ICE,&
    671             HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,&
    672             RDUST,VMR_ICE,RICE,&
     654            HR_SW,HR_LW,HR_DYN,DT_RAD,&
    673655            CLOUDFRAC,TOTCLOUDFRAC,RH,&
    674656            DQICE,DQVAP,REEVAP,SURFRAIN,&
     
    721703    CASE(0)
    722704      SCALAR(i,kps:kpe,j,:)=0.
    723     CASE(20)
    724       !! tracer mode 20 : add a passive tracer with radioactive-like decay
    725       IF ( (i == ips) .AND. (j == jps) )   print *, 'RADIOACTIVE-LIKE TRACER WITH SOURCE AT SURFACE LAYER.'
    726       tau_decay=60.*10. !! why not make it a namelist argument?
    727       SCALAR(i,kps:kpe,j,2) = SCALAR(i,kps:kpe,j,2)*exp(-dt/tau_decay)
    728       SCALAR(i,1,j,2) = SCALAR(i,1,j,2) + 1. !! this tracer is emitted in the surface layer
    729705    CASE(1)
    730706      scalar(i,kps:kpe,j,P_QH2O)=scalar(i,kps:kpe,j,P_QH2O) &
     
    737713      moist(i,kps:kpe,j,P_QV)=moist(i,kps:kpe,j,P_QV) &
    738714          +zdqfi_omp(subs,kps:kpe,1)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
    739       scalar(i,kps:kpe,j,P_QH2O_ICE)=scalar(i,kps:kpe,j,P_QH2O_ICE) &
     715      moist(i,kps:kpe,j,P_QC)=moist(i,kps:kpe,j,P_QC) &
    740716           +zdqfi_omp(subs,kps:kpe,2)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
    741        ! if you want to use this mode, RTHPLATEN should be corrected as below.
    742        ! we keep it like that for the moment for testing.
     717      RTHPLATEN(i,kps:kpe,j) = RTHPLATEN(i,kps:kpe,j) &
     718           * (1.d0+moist(i,kps:kpe,j,P_QV))/(1.d0+rvovrd*moist(i,kps:kpe,j,P_QV))
     719           ! correct dT/dt assuming a constant molar heat capacity.
     720           ! Specific heat cappacity scales with molar mass.
    743721    CASE(43)
     722      moist(i,kps:kpe,j,P_QV)=moist(i,kps:kpe,j,P_QV) &
     723          +zdqfi_omp(subs,kps:kpe,1)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
     724      moist(i,kps:kpe,j,P_QC)=moist(i,kps:kpe,j,P_QC) &
     725           +zdqfi_omp(subs,kps:kpe,2)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
     726      tau_decay=86400.*100. !! why not make it a namelist argument?
     727      SCALAR(i,kps:kpe,j,P_MARKER) = SCALAR(i,kps:kpe,j,P_MARKER)*exp(-dt/tau_decay)
     728      SCALAR(i,1,j,P_MARKER) = 1. !! this tracer is emitted in the surface layer
     729      RTHPLATEN(i,kps:kpe,j) = RTHPLATEN(i,kps:kpe,j) &
     730        * (1.d0+moist(i,kps:kpe,j,P_QV))/(1.d0+rvovrd*moist(i,kps:kpe,j,P_QV))
     731        ! correct dT/dt assuming a constant molar heat capacity.
     732        ! Specific heat cappacity scales with molar mass.
     733    CASE(44)
    744734      moist(i,kps:kpe,j,P_QV)=moist(i,kps:kpe,j,P_QV) &
    745735          +zdqfi_omp(subs,kps:kpe,1)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
    746736      scalar(i,kps:kpe,j,P_QH2O_ICE)=scalar(i,kps:kpe,j,P_QH2O_ICE) &
    747737           +zdqfi_omp(subs,kps:kpe,2)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
    748       RTHPLATEN(i,kps:kpe,j) = RTHPLATEN(i,kps:kpe,j) &
    749         * (1.d0+moist(i,kps:kpe,j,P_QV))/(1.d0+rvovrd*moist(i,kps:kpe,j,P_QV))
    750         ! correct dT/dt assuming a constant molar heat capacity.
    751         ! Specific heat cappacity scales with molar mass.
     738    CASE(45)
     739      moist(i,kps:kpe,j,P_QV)=moist(i,kps:kpe,j,P_QV) &
     740          +zdqfi_omp(subs,kps:kpe,1)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
     741      scalar(i,kps:kpe,j,P_QH2O_ICE)=scalar(i,kps:kpe,j,P_QH2O_ICE) &
     742           +zdqfi_omp(subs,kps:kpe,2)*dt * (1.d0+moist(i,kps:kpe,j,P_QV))
    752743      tau_decay=86400.*100. !! why not make it a namelist argument?
    753744      SCALAR(i,kps:kpe,j,P_MARKER) = SCALAR(i,kps:kpe,j,P_MARKER)*exp(-dt/tau_decay)
  • trunk/WRF.COMMON/INTERFACES_V4/module_model_constants.F

    r2866 r2872  
    312312     rfcp         =0.25/cp
    313313     p608         =rvovrd-1.
    314      z_scale      =(r_d*t0/g)*1e-3
     314     z_scale      =(r_d*t0/g)
    315315    write(*,*) "planet : ", planet
    316316    write(*,*) "g = ", g
Note: See TracChangeset for help on using the changeset viewer.