Ignore:
Timestamp:
Jun 17, 2022, 4:24:49 PM (2 years ago)
Author:
lguez
Message:

Sync latest trunk changes to branch LMDZ-ECRAD.

Location:
LMDZ6/branches/LMDZ-ECRAD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ-ECRAD

  • LMDZ6/branches/LMDZ-ECRAD/libf/phylmd/phyetat0.F90

    r3756 r4171  
    1313       du_gwd_rando, du_gwd_front, entr_therm, f0, fm_therm, &
    1414       falb_dir, falb_dif, prw_ancien, prlw_ancien, prsw_ancien, &
    15        ftsol, pbl_tke, pctsrf, q_ancien, ql_ancien, qs_ancien, radpas, radsol, rain_fall, ratqs, &
     15       ftsol, pbl_tke, pctsrf, q_ancien, ql_ancien, qs_ancien, rneb_ancien, radpas, radsol, rain_fall, ratqs, &
    1616       rnebcon, rugoro, sig1, snow_fall, solaire_etat0, sollw, sollwdown, &
    1717       solsw, solswfdiff, t_ancien, u_ancien, v_ancien, w01, wake_cstar, wake_deltaq, &
    18        wake_deltat, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, &
    19        wake_s, wake_dens, zgam, zmax0, zmea, zpic, zsig, &
     18       wake_deltat, wake_delta_pbl_TKE, delta_tsurf, beta_aridity, wake_fip, wake_pe, &
     19       wake_s, wake_dens, awake_dens, cv_gen, zgam, zmax0, zmea, zpic, zsig, &
    2020       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m, treedrg, &
    21        ale_wake, ale_bl_stat
     21       ale_wake, ale_bl_stat, ds_ns, dt_ns, delta_sst, delta_sal, ratqs_inter
    2222!FC
    23   USE geometry_mod, ONLY : longitude_deg, latitude_deg
    24   USE iostart, ONLY : close_startphy, get_field, get_var, open_startphy
    25   USE infotrac_phy, only: nbtr, nqo, type_trac, tname, niadv
    26   USE traclmdz_mod,    ONLY : traclmdz_from_restart
    27   USE carbon_cycle_mod, ONLY : carbon_cycle_tr, carbon_cycle_cpl, co2_send
    28   USE indice_sol_mod, only: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic
    29   USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init
     23  USE geometry_mod,     ONLY: longitude_deg, latitude_deg
     24  USE iostart,          ONLY: close_startphy, get_field, get_var, open_startphy
     25  USE infotrac_phy,     ONLY: nqtot, nbtr, types_trac, tracers
     26  USE traclmdz_mod,     ONLY: traclmdz_from_restart
     27  USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl, co2_send
     28  USE indice_sol_mod,   ONLY: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic
     29  USE ocean_slab_mod,   ONLY: nslay, tslab, seaice, tice, ocean_slab_init
    3030  USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy
     31#ifdef CPP_XIOS
     32  USE wxios, ONLY: missing_val
     33#else
     34  use netcdf, only: missing_val => nf90_fill_real
     35#endif
     36  use config_ocean_skin_m, only: activate_ocean_skin
    3137
    3238  IMPLICIT none
     
    3541  ! Objet: Lecture de l'etat initial pour la physique
    3642  !======================================================================
    37   include "netcdf.inc"
    3843  include "dimsoil.h"
    3944  include "clesphys.h"
    40   include "thermcell.h"
     45  include "alpale.h"
    4146  include "compbl.h"
    4247  include "YOMCST.h"
     
    7075  INTEGER length
    7176  PARAMETER (length=100)
    72   INTEGER it, iiq, isw
     77  INTEGER it, iq, isw
    7378  REAL tab_cntrl(length), tabcntr0(length)
    7479  CHARACTER*7 str7
     
    356361  ancien_ok=ancien_ok.AND.phyetat0_get(klev,ql_ancien,"QLANCIEN","QLANCIEN",0.)
    357362  ancien_ok=ancien_ok.AND.phyetat0_get(klev,qs_ancien,"QSANCIEN","QSANCIEN",0.)
     363  ancien_ok=ancien_ok.AND.phyetat0_get(klev,rneb_ancien,"RNEBANCIEN","RNEBANCIEN",0.)
    358364  ancien_ok=ancien_ok.AND.phyetat0_get(klev,u_ancien,"UANCIEN","UANCIEN",0.)
    359365  ancien_ok=ancien_ok.AND.phyetat0_get(klev,v_ancien,"VANCIEN","VANCIEN",0.)
     
    368374       (maxval(ql_ancien).EQ.minval(ql_ancien))     .OR. &
    369375       (maxval(qs_ancien).EQ.minval(qs_ancien))     .OR. &
     376       (maxval(rneb_ancien).EQ.minval(rneb_ancien)) .OR. &
    370377       (maxval(prw_ancien).EQ.minval(prw_ancien))   .OR. &
    371378       (maxval(prlw_ancien).EQ.minval(prlw_ancien)) .OR. &
     
    391398  IF (iflag_pbl>1 .AND. iflag_wake>=1  .AND. iflag_pbl_split >=1 ) then
    392399    found=phyetat0_srf(klev+1,wake_delta_pbl_tke,"DELTATKE","Del TKE wk/env",0.)
    393     found=phyetat0_srf(1,delta_tsurf,"DELTA_TSURF","Delta Ts wk/env ",0.)
     400!!    found=phyetat0_srf(1,delta_tsurf,"DELTA_TSURF","Delta Ts wk/env ",0.)
     401    found=phyetat0_srf(1,delta_tsurf,"DELTATS","Delta Ts wk/env ",0.)
     402!!    found=phyetat0_srf(1,beta_aridity,"BETA_S","Aridity factor ",1.)
     403    found=phyetat0_srf(1,beta_aridity,"BETAS","Aridity factor ",1.)
    394404  ENDIF   !(iflag_pbl>1 .AND. iflag_wake>=1 .AND. iflag_pbl_split >=1 )
    395405
     
    411421!!  found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",0.)
    412422  found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",-1000.)
     423  found=phyetat0_get(1,awake_dens,"AWAKE_DENS","Active Wake num. /unit area",0.)
     424  found=phyetat0_get(1,cv_gen,"CV_GEN","CB birth rate",0.)
    413425!>jyg
    414426  found=phyetat0_get(1,wake_cstar,"WAKE_CSTAR","WAKE_CSTAR",0.)
     
    430442  found=phyetat0_get(1,ale_bl_stat,"ALE_BL_STAT","ALE_BL_STAT",0.)
    431443
     444! fisrtilp/Clouds 0.002 could be ratqsbas. But can stay like this as well
     445  found=phyetat0_get(klev,ratqs_inter,"RATQS_INTER","Relative width of the lsc sugrid scale water",0.002)
     446
    432447!===========================================
    433448  ! Read and send field trs to traclmdz
    434449!===========================================
    435450
    436   IF (type_trac == 'lmdz') THEN
    437      DO it=1, nbtr                                                                 
    438 !!        iiq=niadv(it+2)                                                           ! jyg
    439         iiq=niadv(it+nqo)                                                           ! jyg
    440         found=phyetat0_get(1,trs(:,it),"trs_"//tname(iiq), &
    441               "Surf trac"//tname(iiq),0.)
    442      ENDDO
    443      CALL traclmdz_from_restart(trs)
    444   ENDIF
    445 
    446 !--OB now this is for co2i
    447   IF (type_trac == 'co2i') THEN
     451!--OB now this is for co2i - ThL: and therefore also for inco
     452  IF (ANY(types_trac == 'co2i') .OR. ANY(types_trac == 'inco')) THEN
    448453     IF (carbon_cycle_cpl) THEN
    449454        ALLOCATE(co2_send(klon), stat=ierr)
     
    451456        found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm)
    452457     ENDIF
    453   ENDIF
     458  ELSE IF (ANY(types_trac == 'lmdz')) THEN
     459     it = 0
     460     DO iq = 1, nqtot
     461        IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE
     462        it = it+1
     463        found=phyetat0_get(1,trs(:,it),"trs_"//TRIM(tracers(iq)%name), &
     464                                  "Surf trac"//TRIM(tracers(iq)%name),0.)
     465     END DO
     466     CALL traclmdz_from_restart(trs)
     467  ENDIF
     468
    454469
    455470!===========================================
     
    519534  ENDIF ! Slab       
    520535
     536  if (activate_ocean_skin >= 1) then
     537     if (activate_ocean_skin == 2 .and. type_ocean == 'couple') then
     538        found = phyetat0_get(1, delta_sal, "delta_sal", &
     539             "ocean-air interface salinity minus bulk salinity", 0.)
     540        found = phyetat0_get(1, delta_sst, "delta_SST", &
     541             "ocean-air interface temperature minus bulk SST", 0.)
     542     end if
     543     
     544     found = phyetat0_get(1, ds_ns, "dS_ns", "delta salinity near surface", 0.)
     545     found = phyetat0_get(1, dt_ns, "dT_ns", "delta temperature near surface", &
     546          0.)
     547
     548     where (pctsrf(:, is_oce) == 0.)
     549        ds_ns = missing_val
     550        dt_ns = missing_val
     551        delta_sst = missing_val
     552        delta_sal = missing_val
     553     end where
     554  end if
     555
    521556  ! on ferme le fichier
    522557  CALL close_startphy
     
    566601   CALL get_field(name, field, found)
    567602   IF (.NOT. found) THEN
    568      WRITE(lunout,*) "phyetat0: Le champ <",name,"> est absent"
     603     WRITE(lunout,*) "phyetat0: Le champ <",TRIM(name),"> est absent"
    569604     WRITE(lunout,*) "Depart legerement fausse. Mais je continue"
    570605     field(:,:)=default
Note: See TracChangeset for help on using the changeset viewer.