Changeset 5190 for LMDZ6/trunk/libf/dyn3d/dynetat0.F90
- Timestamp:
- Sep 15, 2024, 10:38:32 AM (7 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d/dynetat0.F90
r5183 r5190 6 6 ! Purpose: Initial state reading. 7 7 !------------------------------------------------------------------------------- 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName, & 9 new2oldH2O, newHNO3, oldHNO3 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName 10 9 USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str 11 10 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_INQ_VARID, & 12 11 NF90_CLOSE, NF90_GET_VAR, NF90_NoErr 12 USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey 13 13 USE control_mod, ONLY: planet_type 14 14 USE assert_eq_m, ONLY: assert_eq … … 19 19 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time 20 20 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 21 #ifdef CPP_IOIPSL22 USE IOIPSL, ONLY: getin23 #else24 USE ioipsl_getincom, ONLY: getin25 #endif26 USE iso_params_mod ! tnat_* and alpha_ideal_*27 21 28 22 IMPLICIT NONE … … 48 42 INTEGER :: iq, fID, vID, idecal, iqParent, iName, iZone, iPhase 49 43 REAL :: time, tnat, alpha_ideal, tab_cntrl(length) !--- RUN PARAMS TABLE 50 LOGICAL :: lSkip, ll, ltnat1 44 LOGICAL :: lSkip, ll 45 LOGICAL,PARAMETER :: tnat1=.TRUE. 51 46 !------------------------------------------------------------------------------- 52 47 modname="dynetat0" … … 121 116 var="temps" 122 117 IF(NF90_INQ_VARID(fID,var,vID)/=NF90_NoErr) THEN 123 CALL msg(' Missing field <temps> ; trying with <Time>', modname)118 CALL msg('missing field <temps> ; trying with <Time>', modname) 124 119 var="Time" 125 120 CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var) … … 138 133 ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= NF90_NoErr !--- DETECT OLD REPRO start.nc FILE 139 134 #endif 140 ltnat1 = .TRUE.; CALL getin('tnateq1', ltnat1)141 135 DO iq=1,nqtot 142 136 var = tracers(iq)%name … … 154 148 !-------------------------------------------------------------------------------------------------------------------------- 155 149 ELSE IF(NF90_INQ_VARID(fID, oldVar, vID) == NF90_NoErr) THEN !=== TRY WITH ALTERNATE NAME 156 CALL msg(' Missing tracer <'//TRIM(var)//'>=> initialized to <'//TRIM(oldVar)//'>', modname)150 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to <'//TRIM(oldVar)//'>', modname) 157 151 CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",oldVar) 158 152 !-------------------------------------------------------------------------------------------------------------------------- … … 162 156 iqParent = tracers(iq)%iqParent 163 157 IF(tracers(iq)%iso_iZone == 0) THEN 164 IF(ltnat1) THEN 165 tnat = 1.0 166 alpha_ideal = 1.0 167 CALL msg(' !!! Beware: alpha_ideal put to 1 !!!', modname) 168 ELSE 169 SELECT CASE(isoName(iName)) 170 CASE('H216O'); tnat = tnat_H216O; alpha_ideal = alpha_ideal_H216O 171 CASE('H217O'); tnat = tnat_H217O; alpha_ideal = alpha_ideal_H217O 172 CASE('H218O'); tnat = tnat_H218O; alpha_ideal = alpha_ideal_H218O 173 CASE('HDO'); tnat = tnat_HDO; alpha_ideal = alpha_ideal_HDO 174 CASE('HTO'); tnat = tnat_HTO; alpha_ideal = alpha_ideal_HTO 175 CASE DEFAULT; CALL abort_gcm(TRIM(modname),'unknown isotope "'//TRIM(isoName(iName))//'" ; check tracer.def file',1) 176 END SELECT 177 END IF 178 CALL msg('Missing tracer <'//TRIM(var)//'> => initialized with a simplified Rayleigh distillation law.', modname) 158 if (tnat1) then 159 tnat=1.0 160 alpha_ideal=1.0 161 write(*,*) 'attention dans dynetat0: les alpha_ideal sont a 1' 162 else 163 IF(getKey('tnat', tnat, isoName(iName)) .OR. getKey('alpha', alpha_ideal, isoName(iName))) & 164 CALL abort_gcm(TRIM(modname), 'missing isotopic parameters', 1) 165 endif 166 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized with a simplified Rayleigh distillation law.', modname) 179 167 q(:,:,:,iq) = q(:,:,:,iqParent)*tnat*(q(:,:,:,iqParent)/30.e-3)**(alpha_ideal-1.) 180 168 ELSE 181 CALL msg(' Missing tracer <'//TRIM(var)//'>=> initialized to its parent isotope concentration.', modname)169 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to its parent isotope concentration.', modname) 182 170 ! Camille 9 mars 2023: attention!! seuls les tags qui correspondent à 183 171 ! izone=izone_init (définie dans isotrac_mod) sont initialisés comme … … 193 181 !-------------------------------------------------------------------------------------------------------------------------- 194 182 ELSE !=== MISSING: SET TO 0 195 CALL msg(' Missing tracer <'//TRIM(var)//'>=> initialized to zero', modname)183 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to zero', modname) 196 184 q(:,:,:,iq)=0. 197 185 !--------------------------------------------------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.