Changeset 1232 for trunk/LMDZ.MARS/libf/phymars/newstart.F
- Timestamp:
- Apr 19, 2014, 10:35:38 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.