Changeset 3991 for LMDZ6/branches/LMDZ-tracers
- Timestamp:
- Oct 13, 2021, 4:51:21 PM (3 years ago)
- Location:
- LMDZ6/branches/LMDZ-tracers/libf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynetat0.F90
r3957 r3991 6 6 ! Purpose: Initial state reading. 7 7 !------------------------------------------------------------------------------- 8 USE readTracFiles_mod, ONLY: known_phases, old_phases, nphases, phases_sep9 8 USE infotrac, ONLY: nqtot, niso, tracers, iTraPha, tnat, alpha_ideal, tra 10 9 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_INQ_VARID, NF90_NoErr, & 11 10 NF90_CLOSE, NF90_GET_VAR 12 USE strings_mod, ONLY: strIdx13 11 USE control_mod, ONLY: planet_type 14 12 USE assert_eq_m, ONLY: assert_eq … … 19 17 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time 20 18 USE ener_mod, ONLY: etot0, ptot0, ztot0, stot0, ang0 19 USE strings_mod, ONLY: strIdx 20 USE readTracFiles_mod, ONLY: known_phases, old_phases, nphases, phases_sep 21 21 22 22 IMPLICIT NONE … … 120 120 END IF 121 121 CALL err(NF90_GET_VAR(fID,vID,time),"get",var) 122 CALL get_var 2("phisinit", phis)122 CALL get_var3("vcov", vcov) 123 123 CALL get_var3("ucov", ucov) 124 CALL get_var3("vcov", vcov)125 124 CALL get_var3("teta", teta) 126 125 CALL get_var3("masse", masse) 126 CALL get_var2("phisinit", phis) 127 127 CALL get_var2("ps", ps) 128 128 … … 132 132 var = tr%name 133 133 ix = strIdx([('H2O'//phases_sep//known_phases(ip:ip), ip=1, nphases)], var) 134 IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr) THEN 134 oldH2O = '***'; IF(ix/=0) oldH2O = 'H2O'//old_phases(ix:ix) 135 !------------------------------------------------------------------------------------------------------------------ 136 IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr) THEN !=== REGULAR CASE 135 137 CALL get_var3(var, q(:,:,:,iq)) 138 !------------------------------------------------------------------------------------------------------------------ 136 139 #ifdef INCA 137 ELSE IF(NF90_INQ_VARID(fID, 'OX', vID) == NF90_NoErr .AND. var == 'O3') THEN140 ELSE IF(NF90_INQ_VARID(fID, 'OX', vID) == NF90_NoErr .AND. var == 'O3') THEN !=== INCA: OX INSTEAD OF O3 138 141 WRITE(lunout,*)TRIM(modname)//': Tracer <O3> is missing => initialized to OX' 139 142 CALL get_var3('OX', q(:,:,:,iq)) 140 143 #endif 141 ELSE IF(ix /= 0) THEN !--- Old file, water: H2Ov/l/i instead of H2O_g/_l/_s 142 oldH2O = 'H2O'//old_phases(ix:ix) 143 IF(NF90_INQ_VARID(fID, oldH2O, vID) == NF90_NoErr) THEN 144 WRITE(lunout,*)TRIM(modname)//': Tracer <'//TRIM(var)//'> is missing => initialized to '//TRIM(oldH2O) 145 CALL get_var3(oldH2O, q(:,:,:,iq)) 144 !------------------------------------------------------------------------------------------------------------------ 145 ELSE IF(NF90_INQ_VARID(fID, oldH2O, vID) == NF90_NoErr .AND. ix /= 0 ) THEN !=== OLD WATER PHASES 146 WRITE(lunout,*)TRIM(modname)//': Tracer <'//TRIM(var)//'> is missing => initialized to '//TRIM(oldH2O) 147 CALL get_var3(oldH2O, q(:,:,:,iq)) 148 !------------------------------------------------------------------------------------------------------------------ 149 ELSE IF(niso > 0 .AND. tr%iso_num > 0) THEN !=== ISOTOPES, CRisi 150 IF(tr%iso_zon == 0) THEN 151 WRITE(lunout,*)TRIM(modname)//': Isotope <'//TRIM(var)//'> is missing => initialized with a' & 152 //' simplified Rayleigh distillation law' 153 q(:,:,:,iq) = q(:,:,:,tr%iprnt) * tnat(tr%iso_num) & 154 *(q(:,:,:,tr%iprnt)/30.e-3)**(alpha_ideal(tr%iso_num)-1) 155 ELSE 156 WRITE(lunout,*)TRIM(modname)//': Isotope geographical tracer <'//TRIM(var)//'> is missing ' & 157 //'=> initialized its parent isotope concentration' 158 q(:,:,:,iq) = q(:,:,:,iTraPha(tr%iso_num,tr%iso_pha)) 146 159 END IF 147 ELSE 160 !------------------------------------------------------------------------------------------------------------------ 161 ELSE !=== MISSING: SET TO 0 148 162 WRITE(lunout,*)TRIM(modname)//': Tracer <'//TRIM(var)//'> is missing => initialized to zero' 149 163 q(:,:,:,iq)=0. 150 !--- CRisi: for isotopes, theoretical initialization using very simplified Rayleigh distillation law151 IF(niso > 0 .AND. tr%iso_num > 0) THEN152 IF(tr%iso_zon == 0) q(:,:,:,iq) = q(:,:,:,tr%iprnt) * tnat(tr%iso_num) &153 *(q(:,:,:,tr%iprnt)/30.e-3)**(alpha_ideal(tr%iso_num)-1)154 IF(tr%iso_zon == 1) q(:,:,:,iq) = q(:,:,:,iTraPha(tr%iso_num,tr%iso_pha))155 END IF156 164 END IF 165 !------------------------------------------------------------------------------------------------------------------ 157 166 END DO 158 167 CALL err(NF90_CLOSE(fID),"close",fichnom) -
LMDZ6/branches/LMDZ-tracers/libf/dyn3dmem/dynetat0_loc.F90
r3985 r3991 14 14 USE assert_eq_m, ONLY: assert_eq 15 15 USE comvert_mod, ONLY: pa,preff 16 USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa, lllm, & 17 omeg, rad 16 USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa, lllm, omeg, rad 18 17 USE logic_mod, ONLY: fxyhypb, ysinus 19 18 USE serre_mod, ONLY: clon, clat, grossismx, grossismy 20 USE temps_mod, ONLY: annee_ref,day_ref,itau_dyn, & 21 start_time,day_ini 22 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 19 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time 20 USE ener_mod, ONLY: etot0, ptot0, ztot0, stot0, ang0 23 21 USE strings_mod, ONLY: strIdx 24 22 USE readTracFiles_mod, ONLY: known_phases, old_phases, nphases, phases_sep … … 139 137 var = tr%name 140 138 ix = strIdx([('H2O'//phases_sep//known_phases(ip:ip), ip=1, nphases)], var) 141 IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr) THEN 139 oldH2O = '***'; IF(ix/=0) oldH2O = 'H2O'//old_phases(ix:ix) 140 !------------------------------------------------------------------------------------------------------------------ 141 IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr) THEN !=== REGULAR CASE 142 142 CALL get_var2(var, q(ib:ie,:,iq), ib, ie, nglo) 143 !------------------------------------------------------------------------------------------------------------------ 143 144 #ifdef INCA 144 ELSE IF(NF90_INQ_VARID(fID, 'OX', vID) == NF90_NoErr .AND. var == 'O3') THEN145 ELSE IF(NF90_INQ_VARID(fID, 'OX', vID) == NF90_NoErr .AND. var == 'O3') THEN !=== INCA: OX INSTEAD OF O3 145 146 WRITE(lunout,*)TRIM(modname)//': Tracer <O3> is missing => initialized to OX' 146 147 CALL get_var2('OX', q(ib:ie,:,iq), ib, ie, nglo) 147 148 #endif 148 ELSE IF(ix /= 0) THEN !--- Old file, water: H2Ov/l/i instead of H2O-g/-l/-s 149 oldH2O = 'H2O'//old_phases(ix:ix) 150 IF(NF90_INQ_VARID(fID, oldH2O, vID) == NF90_NoErr) THEN 151 WRITE(lunout,*)TRIM(modname)//': Tracer <'//TRIM(var)//'> is missing => initialized to '//TRIM(oldH2O) 152 CALL get_var2(oldH2O, q(ib:ie,:,iq), ib, ie, nglo) 149 !------------------------------------------------------------------------------------------------------------------ 150 ELSE IF(NF90_INQ_VARID(fID, oldH2O, vID) == NF90_NoErr .AND. ix /= 0 ) THEN !=== OLD WATER PHASES 151 WRITE(lunout,*)TRIM(modname)//': Tracer <'//TRIM(var)//'> is missing => initialized to '//TRIM(oldH2O) 152 CALL get_var2(oldH2O, q(ib:ie,:,iq), ib, ie, nglo) 153 !------------------------------------------------------------------------------------------------------------------ 154 ELSE IF(niso > 0 .AND. tr%iso_num > 0) THEN !=== ISOTOPES, CRisi 155 IF(tr%iso_zon == 0) THEN 156 WRITE(lunout,*)TRIM(modname)//': Isotope <'//TRIM(var)//'> is missing => initialized with a' & 157 //' simplified Rayleigh distillation law' 158 q(:,:,iq) = q(:,:,tr%iprnt) * tnat(tr%iso_num) & 159 *(q(:,:,tr%iprnt)/30.e-3)**(alpha_ideal(tr%iso_num)-1) 160 ELSE 161 WRITE(lunout,*)TRIM(modname)//': Isotope geographical tracer <'//TRIM(var)//'> is missing ' & 162 //'=> initialized its parent isotope concentration' 163 q(:,:,iq) = q(:,:,iTraPha(tr%iso_num,tr%iso_pha)) 153 164 END IF 154 ELSE 165 !------------------------------------------------------------------------------------------------------------------ 166 ELSE !=== MISSING: SET TO 0 155 167 WRITE(lunout,*)TRIM(modname)//': Tracer <'//TRIM(var)//'> is missing => initialized to zero' 156 168 q(ib:ie,:,iq)=0. 157 !--- CRisi: for isotopes, theoretical initialization using very simplified Rayleigh distillation law158 IF(niso > 0 .AND. tr%iso_num > 0) THEN159 IF(tr%iso_zon == 0) q(:,:,iq) = q(:,:,tr%iprnt) * tnat(tr%iso_num) &160 *(q(:,:,tr%iprnt)/30.e-3)**(alpha_ideal(tr%iso_num)-1)161 IF(tr%iso_zon == 1) q(:,:,iq) = q(:,:,iTraPha(tr%iso_num,tr%iso_pha))162 END IF163 169 END IF 170 !------------------------------------------------------------------------------------------------------------------ 164 171 END DO 165 172 CALL err(NF90_CLOSE(fID),"close",fichnom) -
LMDZ6/branches/LMDZ-tracers/libf/misc/readTracFiles_mod.f90
r3985 r3991 927 927 !=== Geographic tagging tracers descending on tracer "iname": mask, names, number 928 928 ll = t(:)%type=='tag' .AND. delPhase(t(:)%nam1) == iname .AND. t(:)%igen == 3 929 s%zone = PACK(strTail(t(:)%name,'_' ), MASK = ll)!--- Tagging zones names for isotopes category "iname"929 s%zone = PACK(strTail(t(:)%name,'_',lFirst=.TRUE.), MASK = ll) !--- Tagging zones names for isotopes category "iname" 930 930 CALL strReduce(s%zone) 931 931 s%nzon = SIZE(s%zone) !--- Tagging zones number for isotopes category "iname"
Note: See TracChangeset
for help on using the changeset viewer.