Changeset 1232 for trunk/LMDZ.MARS/libf
- Timestamp:
- Apr 19, 2014, 10:35:38 AM (11 years ago)
- Location:
- trunk/LMDZ.MARS/libf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/dyn3d/dump2d.F
r38 r1232 37 37 IF(zllm.GT.zmin) THEN 38 38 DO j=1,jm 39 WRITE(*,'(72i1)') (NINT(10.*(z(i,j)-zmin)/(zllm-zmin)),i=1,im) 39 ! WRITE(*,'(72i1)') (NINT(10.*(z(i,j)-zmin)/(zllm-zmin)),i=1,im) 40 WRITE(*,'(72i1)') (NINT(9.*(z(i,j)-zmin)/(zllm-zmin)),i=1,im) 40 41 ENDDO 41 42 ENDIF -
trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F
r1226 r1232 45 45 c======================================================================= 46 46 47 c Old variables dimensions (from file) 48 c------------------------------------ 49 INTEGER imold,jmold,lmold,nsoilold,nqold 50 51 c et autres: 52 c---------- 53 integer,intent(in) :: ngrid ! number of atmospheric columns 47 ! routine arguments 48 ! ----------------- 49 integer,intent(in) :: ngrid ! number of atmosphferic columns 54 50 ! on new physics grid 55 51 integer,intent(in) :: nlayer ! number of atmospheric layers 56 52 ! on new grid 57 53 integer,intent(in) :: nqtot ! number of advected tracers 54 REAL,INTENT(OUT) :: date 55 REAL,INTENT(OUT) :: vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants 56 REAL,INTENT(OUT) :: h(iip1,jjp1,llm),ps(iip1,jjp1) 57 REAL,INTENT(OUT) :: q(iip1,jjp1,llm,nqtot) 58 REAL,INTENT(OUT) :: tsurf(ngrid) ! surface temperature 59 REAL,INTENT(OUT) :: tsoil(ngrid,nsoilmx) ! soil temperature 60 REAL,INTENT(OUT) :: co2ice(ngrid) ! CO2 ice layer 61 REAL,INTENT(OUT) :: emis(ngrid) 62 REAL,INTENT(OUT) :: q2(ngrid,nlayer+1),qsurf(ngrid,nqtot) 63 REAL,INTENT(OUT) :: tauscaling(ngrid) ! dust conversion factor 64 REAL,INTENT(OUT) :: phisold_newgrid(iip1,jjp1) 65 REAL,INTENT(OUT) :: t(iip1,jjp1,llm) 66 real,intent(in) :: surfith(iip1,jjp1) ! surface thermal inertia 67 INTEGER,INTENT(IN) :: nid ! input NetCDF file identifier 68 69 70 71 c Old variables dimensions (from file) 72 c------------------------------------ 73 INTEGER imold,jmold,lmold,nsoilold,nqold 58 74 59 75 c Variables pour les lectures des fichiers "ini" … … 82 98 83 99 ! INTEGER vardim(4) 84 REAL date85 100 INTEGER memo 86 101 ! character (len=50) :: tmpname … … 88 103 c Variable histoire 89 104 c------------------ 90 REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants 91 REAL h(iip1,jjp1,llm),ps(iip1,jjp1) 92 REAL q(iip1,jjp1,llm,nqtot),qtot(iip1,jjp1,llm) 105 REAL ::qtot(iip1,jjp1,llm) 93 106 94 107 c autre variables dynamique nouvelle grille … … 104 117 c variable physique 105 118 c------------------ 106 REAL tsurf(ngrid) ! surface temperature107 REAL tsoil(ngrid,nsoilmx) ! soil temperature108 REAL co2ice(ngrid) ! CO2 ice layer109 REAL emis(ngrid)110 REAL q2(ngrid,nlayer+1),qsurf(ngrid,nqtot)111 REAL tauscaling(ngrid) ! dust conversion factor112 119 c REAL phisfi(ngrid) 113 120 114 121 INTEGER i,j,l 115 INTEGER n id,nvarid122 INTEGER nvarid 116 123 c REAL year_day,periheli,aphelie,peri_day 117 124 c REAL obliquit,z0,emin_turb,lmixmin … … 131 138 c------------------------------------------------------ 132 139 real us(iip1,jjp1,llm),vs(iip1,jjp1,llm) 133 REAL phisold_newgrid(iip1,jjp1)134 REAL t(iip1,jjp1,llm)135 140 real tsurfS(iip1,jjp1),tsoilS(iip1,jjp1,nsoilmx) 136 141 real inertiedatS(iip1,jjp1,nsoilmx) … … 184 189 ! real, dimension(:), allocatable :: oldmlayer 185 190 186 real surfith(iip1,jjp1) ! surface thermal inertia187 191 ! real surfithfi(ngrid) 188 192 ! surface thermal inertia at old horizontal grid resolution … … 231 235 endif 232 236 ierr= NF_INQ_DIMLEN(nid,dimid,timelen) 237 if (ierr.ne.NF_NOERR) then 238 write(*,*) 'lect_start_archive error: cannot find Time length' 239 stop 240 else 241 write(*,*) "lect_start_archive: timelen=",timelen 242 endif 233 243 234 244 ierr= NF_INQ_DIMID(nid,"latitude",dimid) … … 237 247 endif 238 248 ierr= NF_INQ_DIMLEN(nid,dimid,jmold) 249 if (ierr.ne.NF_NOERR) then 250 write(*,*) 'lect_start_archive error: cannot find lat length' 251 stop 252 else 253 write(*,*) "lect_start_archive: jmold=",jmold 254 endif 239 255 jmold=jmold-1 240 256 … … 244 260 endif 245 261 ierr= NF_INQ_DIMLEN(nid,dimid,imold) 262 if (ierr.ne.NF_NOERR) then 263 write(*,*) 'lect_start_archive error: cannot find lon length' 264 stop 265 else 266 write(*,*) "lect_start_archive: imold=",imold 267 endif 246 268 imold=imold-1 247 269 … … 251 273 endif 252 274 ierr= NF_INQ_DIMLEN(nid,dimid,lmold) 275 if (ierr.ne.NF_NOERR) then 276 write(*,*) 'lect_start_archive error: cannot find alt length' 277 stop 278 else 279 write(*,*) "lect_start_archive: lmold=",lmold 280 endif 253 281 254 282 nqold=0 … … 298 326 ! 1.3 Report dimensions 299 327 300 write(*,*) " Start_archive dimensions:"328 write(*,*) "lect_start_archive: Start_archive dimensions:" 301 329 write(*,*) "longitude: ",imold 302 330 write(*,*) "latitude: ",jmold 303 331 write(*,*) "altitude: ",lmold 304 write(*,*) "tracers: ",nqold 332 if (nqold.gt.0) then 333 write(*,*) "old tracers q*: ",nqold 334 endif 305 335 write(*,*) "subsurface_layers: ",nsoilold 306 336 if (depthinterpol) then … … 1281 1311 & rlonuold,rlatvold,rlonu,rlatv) 1282 1312 call scal_wind(us,vs,unat,vnat) 1283 write (*,*) 'lect_start_archive: unat ', unat (1, 2,1) ! INFO1313 write (*,*) 'lect_start_archive: unat ', unat (1,1,1) ! INFO 1284 1314 do l=1,llm 1285 1315 do j = 1, jjp1 … … 1290 1320 end do 1291 1321 end do 1292 write (*,*) 'lect_start_archive: ucov ', ucov (1, 2,1) ! INFO1322 write (*,*) 'lect_start_archive: ucov ', ucov (1,1,1) ! INFO 1293 1323 c write(48,*) 'ucov',ucov 1294 1324 do l=1,llm -
trunk/LMDZ.MARS/libf/phymars/newstart.F
r1231 r1232 15 15 c======================================================================= 16 16 17 ! to use 'getin'18 17 use ioipsl_getincom, only: getin 19 18 use infotrac, only: iniadvtrac, nqtot, tname 20 use tracer_mod, only: noms, igcm_dust_number, igcm_dust_mass, 19 use tracer_mod, only: noms, mmol, 20 & igcm_dust_number, igcm_dust_mass, 21 21 & igcm_ccn_number, igcm_ccn_mass, 22 & igcm_h2o_vap, igcm_h2o_ice 22 & igcm_h2o_vap, igcm_h2o_ice, igcm_co2, 23 & igcm_n2, igcm_ar, igcm_o2, igcm_co 23 24 use surfdat_h, only: phisfi, z0, zmea, zstd, zsig, zgam, zthe, 24 & albedodat, z0_default 25 use comsoil_h, only: inertiedat, layer, mlayer, nsoilmx 25 & albedodat, z0_default, qsurf, tsurf, 26 & co2ice, emis 27 use comsoil_h, only: inertiedat, layer, mlayer, nsoilmx, tsoil 26 28 use control_mod, only: day_step, iphysiq, anneeref 27 29 use phyredem, only: physdem0, physdem1 28 30 use iostart, only: open_startphy 29 31 use comgeomphy, only: initcomgeomphy 30 use planete_h 32 ! use planete_h 33 use dimradmars_mod, only: tauscaling 34 use turb_mod, only: q2 31 35 implicit none 32 36 … … 69 73 c-------------------------------------------------- 70 74 INTEGER nid_dyn, nid_fi,nid,nvarid 71 ! INTEGER size72 INTEGER length73 parameter (length = 100)74 75 INTEGER tab0 75 INTEGER NB_ETATMAX76 parameter (NB_ETATMAX = 100)77 76 78 77 REAL date … … 105 104 c variable physique 106 105 c------------------ 107 REAL tsurf(ngridmx) ! surface temperature 108 REAL tsoil(ngridmx,nsoilmx) ! soil temperature109 REAL co2ice(ngridmx) ! CO2 ice layer110 REAL emis(ngridmx) ! surface emissivity111 REAL tauscaling(ngridmx) ! dust conversion factor106 ! REAL tsurf(ngridmx) ! surface temperature 107 ! REAL tsoil(ngridmx,nsoilmx) ! soil temperature 108 ! REAL co2ice(ngridmx) ! CO2 ice layer 109 ! REAL emis(ngridmx) ! surface emissivity 110 ! REAL tauscaling(ngridmx) ! dust conversion factor 112 111 REAL tauscadyn(iip1,jjp1) ! dust conversion factor on the dynamics grid 113 REAL,ALLOCATABLE :: qsurf(:,:)114 REAL q2(ngridmx,nlayermx+1)112 ! REAL,ALLOCATABLE :: qsurf(:,:) 113 ! REAL q2(ngridmx,nlayermx+1) 115 114 ! REAL rnaturfi(ngridmx) 116 115 real alb(iip1,jjp1),albfi(ngridmx) ! albedos … … 122 121 real mugaz ! molar mass of the atmosphere 123 122 124 EXTERNAL iniconst,geopot,inigeom125 123 integer ierr !, nbetat 126 integer ismin127 external ismin128 124 129 125 c Variables on the new grid along scalar points … … 181 177 real :: MONS_coeffN ! coeff for northern hemisphere 182 178 ! real,parameter :: icedepthmin=1.e-3 ! Ice begins at most at that depth 179 ! Reference position for composition 180 real :: latref,lonref,dlatmin,dlonmin 181 ! Variable used to change composition 182 real :: Svmr,Smmr,Smmr_old,Smmr_new,Sn 183 real :: Mair_old,Mair_new,vmr_old,vmr_new 184 real,allocatable :: coefvmr(:) ! Correction coefficient when changing composition 183 185 184 186 c sortie visu pour les champs dynamiques … … 200 202 ! allocate arrays 201 203 allocate(q(iip1,jjp1,llm,nqtot)) 202 allocate(qsurf(ngridmx,nqtot)) 203 204 ! allocate(qsurf(ngridmx,nqtot)) ! done in ini_surfdat_h 205 allocate(coefvmr(nqtot)) 206 204 207 c======================================================================= 205 208 c Choice of the start file(s) to use … … 521 524 write(*,*) 'ini_q-h2o : tracers initialization for chemistry 522 525 $ only' 526 write(*,*) 'composition : change atm main composition: CO2,N2,Ar, 527 $ O2,CO' 523 528 write(*,*) 'ini_h2osurf : reinitialize surface water ice ' 524 529 write(*,*) 'noglacier : Remove tropical H2O ice if |lat|<45' … … 974 979 write(*,*) 'inichim_newstart: chemical species initialised 975 980 $ (except water vapour)' 981 982 c composition : change main composition: CO2,N2,Ar,O2,CO (FF 03/2014) 983 c -------------------------------------------------------- 984 else if (trim(modif) .eq. 'composition') then 985 write(*,*) "Lat (degN) lon (degE) of the reference site ?" 986 write(*,*) "e.g. MSL : -4.5 137. " 987 301 read(*,*,iostat=ierr) latref, lonref 988 if(ierr.ne.0) goto 301 989 990 991 ! Select GCM point close to reference site 992 dlonmin =90. 993 DO i=1,iip1-1 994 if (abs(rlonv(i)*180./pi -lonref).lt.dlonmin)then 995 iref=i 996 dlonmin=abs(rlonv(i)*180./pi -lonref) 997 end if 998 ENDDO 999 dlatmin =45. 1000 DO j=1,jjp1 1001 if (abs(rlatu(j)*180./pi -latref).lt.dlatmin)then 1002 jref=j 1003 dlatmin=abs(rlatu(j)*180./pi -latref) 1004 end if 1005 ENDDO 1006 write(*,*) "In GCM : lat= " , rlatu(jref)*180./pi 1007 write(*,*) "In GCM : lon= " , rlonv(iref)*180./pi 1008 write(*,*) 1009 1010 ! Compute air molar mass at reference site 1011 Smmr=0 1012 Sn = 0 1013 do iq=1,nqtot 1014 if ((iq.eq.igcm_co2).or.(iq.eq.igcm_n2) 1015 & .or. (iq.eq.igcm_ar).or.(iq.eq.igcm_o2) 1016 & .or. (iq.eq.igcm_co)) then 1017 Smmr=Smmr+q(iref,jref,1,iq) 1018 Sn=Sn+q(iref,jref,1,iq)/mmol(iq) 1019 end if 1020 end do 1021 write(*,*) "At reference site : " 1022 write(*,*) "Sum of mass mix. ratio (should be about 1)=",Smmr 1023 Mair_old =Smmr/Sn 1024 write(*,*) 1025 & "Air molar mass (g/mol) at reference site= ",Mair_old 1026 1027 ! Ask for new volume mixing ratio at reference site 1028 Svmr =0. 1029 Sn =0. 1030 do iq=1,nqtot 1031 coefvmr(iq) = 1. 1032 if ((iq.eq.igcm_n2).or.(iq.eq.igcm_ar) 1033 & .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then 1034 1035 vmr_old=q(iref,jref,1,iq)*Mair_old/mmol(iq) 1036 write(*,*) "Previous vmr("//trim(tname(iq))//")= ", vmr_old 1037 1038 if (iq.eq.igcm_n2) then 1039 write(*,*) "New vmr(n2)? (MSL: 1.89E-02 at Ls~186)" 1040 endif 1041 if (iq.eq.igcm_ar) then 1042 write(*,*) "New vmr(ar)? (MSL: 1.93E-02 at Ls~186)" 1043 endif 1044 if (iq.eq.igcm_o2) then 1045 write(*,*) "New vmr(o2)? (MSL: 1.46E-03) at Ls~186" 1046 endif 1047 if (iq.eq.igcm_co) then 1048 write(*,*) "New vmr(co)? (~8.E-04)" 1049 endif 1050 302 read(*,*,iostat=ierr) vmr_new 1051 if(ierr.ne.0) goto 302 1052 write(*,*) "New vmr("//trim(tname(iq))//")= ",vmr_new 1053 write(*,*) 1054 coefvmr(iq) = vmr_new/vmr_old 1055 Svmr=Svmr+vmr_new 1056 Sn=Sn+vmr_new*mmol(iq) 1057 end if 1058 enddo ! of do iq=1,nqtot 1059 ! Estimation of new Air molar mass at reference site (assuming vmr_co2 = 1-Svmr) 1060 Mair_new = Sn + (1-Svmr)*mmol(igcm_co2) 1061 write(*,*) 1062 & "NEW Air molar mass (g/mol) at reference site= ",Mair_new 1063 1064 ! Compute mass mixing ratio changes 1065 do iq=1,nqtot 1066 if ((iq.eq.igcm_n2).or.(iq.eq.igcm_ar) 1067 & .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then 1068 write(*,*) "Everywhere mmr("//trim(tname(iq))// 1069 & ") is multiplied by ",coefvmr(iq)*Mair_old/Mair_new 1070 end if 1071 end do 1072 1073 ! Recompute mass mixing ratios everywhere, and adjust mmr(CO2) to keep sum of mmr constant. 1074 do l=1,llm 1075 do j=1,jjp1 1076 do i=1,iip1 1077 Smmr_old = 0. 1078 Smmr_new = 0. 1079 do iq=1,nqtot 1080 if ((iq.eq.igcm_n2).or.(iq.eq.igcm_ar) 1081 & .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then 1082 Smmr_old = Smmr_old + q(i,j,l,iq) ! sum of old mmr 1083 q(i,j,l,iq)=q(i,j,l,iq)*coefvmr(iq)*Mair_old/Mair_new 1084 Smmr_new = Smmr_new + q(i,j,l,iq) ! sum of new mmr 1085 end if 1086 enddo 1087 q(i,j,l,igcm_co2) = q(i,j,l,igcm_co2) + Smmr_old-Smmr_new 1088 enddo 1089 enddo 1090 enddo 1091 1092 write(*,*) 1093 & "mmr(CO2) is modified everywhere to keep sum of mmr constant" 1094 write(*,*) 'At reference site vmr(CO2)=', 1095 & q(iref,jref,1,igcm_co2)*Mair_new/mmol(igcm_co2) 1096 write(*,*) "Compared to MSL observation: vmr(CO2)= 0.9597" 1097 976 1098 977 1099 c wetstart : wet atmosphere with a north to south gradient
Note: See TracChangeset
for help on using the changeset viewer.