Changeset 5183 for LMDZ6/trunk/libf/dyn3d
- Timestamp:
- Sep 10, 2024, 5:14:23 PM (2 months ago)
- Location:
- LMDZ6/trunk/libf/dyn3d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d/check_isotopes.F90
r4984 r5183 2 2 USE strings_mod, ONLY: maxlen, msg, strIdx, strStack, int2str, real2str 3 3 USE infotrac, ONLY: nqtot, niso, nphas, isotope, isoCheck, iqIsoPha, isoSelect, & 4 ntiso, iH2O, nzone, tracers, isoName, itZonIso, getKey 4 ntiso, iH2O, nzone, tracers, isoName, itZonIso 5 USE iso_params_mod, ONLY: tnat_H216O, tnat_H217O, tnat_H218O, tnat_HDO, tnat_HTO 6 USE ioipsl_getincom, ONLY: getin 5 7 IMPLICIT NONE 6 8 include "dimensions.h" … … 20 22 deltaDmin =-999.0, & 21 23 ridicule = 1e-12 22 INTEGER, SAVE :: iso_eau, iso_HDO, iso_O18, & 23 iso_O17, iso_HTO 24 LOGICAL, SAVE :: first=.TRUE. 25 LOGICAL, PARAMETER :: tnat1=.TRUE. 24 INTEGER, SAVE :: iso_eau, iso_O17, iso_O18, iso_HDO, iso_HTO 25 LOGICAL, SAVE :: ltnat1, first=.TRUE. 26 26 27 27 modname='check_isotopes' … … 30 30 IF(niso == 0) RETURN !--- No isotopes => finished 31 31 IF(first) THEN 32 iso_eau = strIdx(isoName,'H216O') 33 iso_HDO = strIdx(isoName,'HDO') 34 iso_O18 = strIdx(isoName,'H218O') 35 iso_O17 = strIdx(isoName,'H217O') 36 iso_HTO = strIdx(isoName,'HTO') 37 if (tnat1) then 38 tnat(:)=1.0 39 else 40 IF(getKey('tnat', tnat)) CALL abort_gcm(modname, 'missing isotopic parameter', 1) 41 endif 32 ltnat1 = .TRUE.; CALL getin('tnateq1', ltnat1) 33 ALLOCATE(tnat(niso)) 34 iso_eau = strIdx(isoName,'H216O'); IF(iso_eau /= 0) tnat(iso_eau) = tnat_H216O 35 iso_O17 = strIdx(isoName,'H217O'); IF(iso_O17 /= 0) tnat(iso_O17) = tnat_H217O 36 iso_O18 = strIdx(isoName,'H218O'); IF(iso_O18 /= 0) tnat(iso_O18) = tnat_H218O 37 iso_HDO = strIdx(isoName,'HDO'); IF(iso_HDO /= 0) tnat(iso_HDO) = tnat_HDO 38 iso_HTO = strIdx(isoName,'HTO'); IF(iso_HTO /= 0) tnat(iso_HTO) = tnat_HTO 39 IF(ltnat1) tnat(:) = 1. 42 40 first = .FALSE. 43 41 END IF -
LMDZ6/trunk/libf/dyn3d/dynetat0.F90
r5084 r5183 6 6 ! Purpose: Initial state reading. 7 7 !------------------------------------------------------------------------------- 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName, & 9 new2oldH2O, newHNO3, oldHNO3 9 10 USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str 10 11 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_INQ_VARID, & 11 12 NF90_CLOSE, NF90_GET_VAR, NF90_NoErr 12 USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey13 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_IOIPSL 22 USE IOIPSL, ONLY: getin 23 #else 24 USE ioipsl_getincom, ONLY: getin 25 #endif 26 USE iso_params_mod ! tnat_* and alpha_ideal_* 21 27 22 28 IMPLICIT NONE … … 42 48 INTEGER :: iq, fID, vID, idecal, iqParent, iName, iZone, iPhase 43 49 REAL :: time, tnat, alpha_ideal, tab_cntrl(length) !--- RUN PARAMS TABLE 44 LOGICAL :: lSkip, ll 45 LOGICAL,PARAMETER :: tnat1=.TRUE. 50 LOGICAL :: lSkip, ll, ltnat1 46 51 !------------------------------------------------------------------------------- 47 52 modname="dynetat0" … … 116 121 var="temps" 117 122 IF(NF90_INQ_VARID(fID,var,vID)/=NF90_NoErr) THEN 118 CALL msg(' missing field <temps> ; trying with <Time>', modname)123 CALL msg('Missing field <temps> ; trying with <Time>', modname) 119 124 var="Time" 120 125 CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var) … … 133 138 ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= NF90_NoErr !--- DETECT OLD REPRO start.nc FILE 134 139 #endif 140 ltnat1 = .TRUE.; CALL getin('tnateq1', ltnat1) 135 141 DO iq=1,nqtot 136 142 var = tracers(iq)%name … … 148 154 !-------------------------------------------------------------------------------------------------------------------------- 149 155 ELSE IF(NF90_INQ_VARID(fID, oldVar, vID) == NF90_NoErr) THEN !=== TRY WITH ALTERNATE NAME 150 CALL msg(' Tracer <'//TRIM(var)//'> is missing=> initialized to <'//TRIM(oldVar)//'>', modname)156 CALL msg('Missing tracer <'//TRIM(var)//'> => initialized to <'//TRIM(oldVar)//'>', modname) 151 157 CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",oldVar) 152 158 !-------------------------------------------------------------------------------------------------------------------------- … … 156 162 iqParent = tracers(iq)%iqParent 157 163 IF(tracers(iq)%iso_iZone == 0) THEN 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) 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) 167 179 q(:,:,:,iq) = q(:,:,:,iqParent)*tnat*(q(:,:,:,iqParent)/30.e-3)**(alpha_ideal-1.) 168 180 ELSE 169 CALL msg(' Tracer <'//TRIM(var)//'> is missing=> initialized to its parent isotope concentration.', modname)181 CALL msg('Missing tracer <'//TRIM(var)//'> => initialized to its parent isotope concentration.', modname) 170 182 ! Camille 9 mars 2023: attention!! seuls les tags qui correspondent à 171 183 ! izone=izone_init (définie dans isotrac_mod) sont initialisés comme … … 181 193 !-------------------------------------------------------------------------------------------------------------------------- 182 194 ELSE !=== MISSING: SET TO 0 183 CALL msg(' Tracer <'//TRIM(var)//'> is missing=> initialized to zero', modname)195 CALL msg('Missing tracer <'//TRIM(var)//'> => initialized to zero', modname) 184 196 q(:,:,:,iq)=0. 185 197 !-------------------------------------------------------------------------------------------------------------------------- -
LMDZ6/trunk/libf/dyn3d/iniacademic.F90
r5084 r5183 5 5 6 6 USE filtreg_mod, ONLY: inifilr 7 USE infotrac, ONLY: nqtot, niso, iqIsoPha, tracers, getKey, isoName 7 USE infotrac, ONLY: nqtot, niso, iqIsoPha, tracers, getKey, isoName, addPhase 8 8 USE control_mod, ONLY: day_step,planet_type 9 9 use exner_hyb_m, only: exner_hyb … … 21 21 USE temps_mod, ONLY: annee_ref, day_ini, day_ref 22 22 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 23 USE readTracFiles_mod, ONLY: addPhase24 23 use netcdf, only : NF90_NOWRITE,NF90_OPEN,NF90_NOERR,NF90_INQ_VARID 25 24 use netcdf, only : NF90_CLOSE, NF90_GET_VAR 25 USE iso_params_mod ! tnat_* and alpha_ideal_* 26 26 27 27 … … 80 80 81 81 REAL zdtvr, tnat, alpha_ideal 82 LOGICAL ,PARAMETER :: tnat1=.true.82 LOGICAL :: ltnat1 83 83 84 84 character(len=*),parameter :: modname="iniacademic" … … 309 309 ! bulk initialization of tracers 310 310 if (planet_type=="earth") then 311 ltnat1 = .TRUE.; CALL getin('tnateq1', ltnat1) 311 312 ! Earth: first two tracers will be water 312 313 do iq=1,nqtot … … 322 323 iqParent = tracers(iq)%iqParent 323 324 IF(tracers(iq)%iso_iZone == 0) THEN 324 if (tnat1) then 325 tnat=1.0 326 alpha_ideal=1.0 327 write(*,*) 'Attention dans iniacademic: alpha_ideal=1' 328 else 329 IF(getKey('tnat', tnat, isoName(iName)) .OR. getKey('alpha', alpha_ideal, isoName(iName))) & 330 CALL abort_gcm(TRIM(modname), 'missing isotopic parameters', 1) 331 endif 325 IF(ltnat1) THEN 326 tnat = 1.0 327 alpha_ideal = 1.0 328 WRITE(lunout, *)'In '//TRIM(modname)//': !!! Beware: alpha_ideal put to 1 !!!' 329 ELSE 330 SELECT CASE(isoName(iName)) 331 CASE('H216O'); tnat = tnat_H216O; alpha_ideal = alpha_ideal_H216O 332 CASE('H217O'); tnat = tnat_H217O; alpha_ideal = alpha_ideal_H217O 333 CASE('H218O'); tnat = tnat_H218O; alpha_ideal = alpha_ideal_H218O 334 CASE('HDO'); tnat = tnat_HDO; alpha_ideal = alpha_ideal_HDO 335 CASE('HTO'); tnat = tnat_HTO; alpha_ideal = alpha_ideal_HTO 336 CASE DEFAULT 337 CALL abort_gcm(TRIM(modname),'unknown isotope "'//TRIM(isoName(iName))//'" ; check tracer.def file',1) 338 END SELECT 339 END IF 332 340 q(:,:,iq) = q(:,:,iqParent)*tnat*(q(:,:,iqParent)/30.e-3)**(alpha_ideal-1.) 333 341 ELSE !IF(tracers(iq)%iso_iZone == 0) THEN -
LMDZ6/trunk/libf/dyn3d/qminimum.F
r5001 r5183 4 4 SUBROUTINE qminimum( q,nqtot,deltap ) 5 5 6 USE infotrac, ONLY: niso, ntiso, iqIsoPha, tracers6 USE infotrac, ONLY: niso, ntiso, iqIsoPha, tracers, addPhase 7 7 USE strings_mod, ONLY: strIdx 8 USE readTracFiles_mod, ONLY: addPhase9 8 IMPLICIT none 10 9 c
Note: See TracChangeset
for help on using the changeset viewer.