1 | C====================================================================== |
---|
2 | PROGRAM newstart |
---|
3 | c======================================================================= |
---|
4 | c |
---|
5 | c |
---|
6 | c Auteur: Christophe Hourdin/Francois Forget/Yann Wanherdrick |
---|
7 | c ------ |
---|
8 | c Derniere modif : 12/03 |
---|
9 | c |
---|
10 | c |
---|
11 | c Objet: Create or modify the initial state for the LMD Mars GCM |
---|
12 | c ----- (fichiers NetCDF start et startfi) |
---|
13 | c |
---|
14 | c |
---|
15 | c======================================================================= |
---|
16 | |
---|
17 | implicit none |
---|
18 | |
---|
19 | #include "dimensions.h" |
---|
20 | #include "dimphys.h" |
---|
21 | #include "surfdat.h" |
---|
22 | #include "comsoil.h" |
---|
23 | #include "planete.h" |
---|
24 | #include "paramet.h" |
---|
25 | #include "comconst.h" |
---|
26 | #include "comvert.h" |
---|
27 | #include "comgeom2.h" |
---|
28 | #include "control.h" |
---|
29 | #include "logic.h" |
---|
30 | #include "description.h" |
---|
31 | #include "ener.h" |
---|
32 | #include "temps.h" |
---|
33 | #include "lmdstd.h" |
---|
34 | #include "comdissnew.h" |
---|
35 | #include "clesph0.h" |
---|
36 | #include "serre.h" |
---|
37 | #include "netcdf.inc" |
---|
38 | #include "advtrac.h" |
---|
39 | #include "tracer.h" |
---|
40 | c======================================================================= |
---|
41 | c Declarations |
---|
42 | c======================================================================= |
---|
43 | |
---|
44 | c Variables dimension du fichier "start_archive" |
---|
45 | c------------------------------------ |
---|
46 | CHARACTER relief*3 |
---|
47 | |
---|
48 | |
---|
49 | c Variables pour les lectures NetCDF des fichiers "start_archive" |
---|
50 | c-------------------------------------------------- |
---|
51 | INTEGER nid_dyn, nid_fi,nid,nvarid |
---|
52 | INTEGER length |
---|
53 | parameter (length = 100) |
---|
54 | INTEGER tab0 |
---|
55 | INTEGER NB_ETATMAX |
---|
56 | parameter (NB_ETATMAX = 100) |
---|
57 | |
---|
58 | REAL date |
---|
59 | REAL p_rad,p_omeg,p_g,p_cpp,p_mugaz,p_daysec |
---|
60 | |
---|
61 | c Variable histoire |
---|
62 | c------------------ |
---|
63 | REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants |
---|
64 | REAL phis(iip1,jjp1) |
---|
65 | REAL q(iip1,jjp1,llm,nqmx) ! champs advectes |
---|
66 | |
---|
67 | c autre variables dynamique nouvelle grille |
---|
68 | c------------------------------------------ |
---|
69 | REAL pks(iip1,jjp1) |
---|
70 | REAL w(iip1,jjp1,llm+1) |
---|
71 | REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm) |
---|
72 | ! REAL dv(ip1jm,llm),du(ip1jmp1,llm) |
---|
73 | ! REAL dh(ip1jmp1,llm),dp(ip1jmp1) |
---|
74 | REAL phi(iip1,jjp1,llm) |
---|
75 | |
---|
76 | integer klatdat,klongdat |
---|
77 | PARAMETER (klatdat=180,klongdat=360) |
---|
78 | |
---|
79 | c Physique sur grille scalaire |
---|
80 | c---------------------------- |
---|
81 | real zmeaS(iip1,jjp1),zstdS(iip1,jjp1) |
---|
82 | real zsigS(iip1,jjp1),zgamS(iip1,jjp1),ztheS(iip1,jjp1) |
---|
83 | |
---|
84 | c variable physique |
---|
85 | c------------------ |
---|
86 | REAL tsurf(ngridmx) ! surface temperature |
---|
87 | REAL tsoil(ngridmx,nsoilmx) ! soil temperature |
---|
88 | ! REAL co2ice(ngridmx) ! CO2 ice layer |
---|
89 | REAL emis(ngridmx) ! surface emissivity |
---|
90 | real emisread ! added by RW |
---|
91 | REAL qsurf(ngridmx,nqmx) |
---|
92 | REAL q2(ngridmx,nlayermx+1) |
---|
93 | ! REAL rnaturfi(ngridmx) |
---|
94 | real alb(iip1,jjp1),albfi(ngridmx) ! albedos |
---|
95 | real ith(iip1,jjp1,nsoilmx),ithfi(ngridmx,nsoilmx) ! thermal inertia (3D) |
---|
96 | real surfith(iip1,jjp1),surfithfi(ngridmx) ! surface thermal inertia (2D) |
---|
97 | REAL latfi(ngridmx),lonfi(ngridmx),airefi(ngridmx) |
---|
98 | |
---|
99 | INTEGER i,j,l,isoil,ig,idum |
---|
100 | real mugaz ! molar mass of the atmosphere |
---|
101 | |
---|
102 | integer ierr |
---|
103 | |
---|
104 | c Variables on the new grid along scalar points |
---|
105 | c------------------------------------------------------ |
---|
106 | ! REAL p(iip1,jjp1) |
---|
107 | REAL t(iip1,jjp1,llm) |
---|
108 | REAL tset(iip1,jjp1,llm) |
---|
109 | real phisold_newgrid(iip1,jjp1) |
---|
110 | REAL :: teta(iip1, jjp1, llm) |
---|
111 | REAL :: pk(iip1,jjp1,llm) |
---|
112 | REAL :: pkf(iip1,jjp1,llm) |
---|
113 | REAL :: ps(iip1, jjp1) |
---|
114 | REAL :: masse(iip1,jjp1,llm) |
---|
115 | REAL :: xpn,xps,xppn(iim),xpps(iim) |
---|
116 | REAL :: p3d(iip1, jjp1, llm+1) |
---|
117 | REAL :: beta(iip1,jjp1,llm) |
---|
118 | ! REAL dteta(ip1jmp1,llm) |
---|
119 | |
---|
120 | c Variable de l'ancienne grille |
---|
121 | c------------------------------ |
---|
122 | real time |
---|
123 | real tab_cntrl(100) |
---|
124 | real tab_cntrl_bis(100) |
---|
125 | |
---|
126 | c variables diverses |
---|
127 | c------------------- |
---|
128 | real choix_1,pp |
---|
129 | character*80 fichnom |
---|
130 | integer Lmodif,iq,thermo |
---|
131 | character modif*20 |
---|
132 | real z_reel(iip1,jjp1) |
---|
133 | real tsud,albsud,alb_bb,ith_bb,Tiso,Tabove |
---|
134 | real ptoto,pcap,patm,airetot,ptotn,patmn,psea |
---|
135 | ! real ssum |
---|
136 | character*1 yes |
---|
137 | logical :: flagtset=.false. , flagps0=.false. |
---|
138 | real val, val2, val3 ! to store temporary variables |
---|
139 | real :: iceith=2000 ! thermal inertia of subterranean ice |
---|
140 | integer iref,jref |
---|
141 | |
---|
142 | INTEGER :: itau |
---|
143 | |
---|
144 | INTEGER :: nq,numvanle |
---|
145 | character(len=20) :: txt ! to store some text |
---|
146 | integer :: count |
---|
147 | |
---|
148 | ! MONS data: |
---|
149 | real :: MONS_Hdn(iip1,jjp1) ! Hdn: %WEH=Mass fraction of H2O |
---|
150 | real :: MONS_d21(iip1,jjp1) ! ice table "depth" (in kg/m2) |
---|
151 | ! coefficient to apply to convert d21 to 'true' depth (m) |
---|
152 | real :: MONS_coeff |
---|
153 | real :: MONS_coeffS ! coeff for southern hemisphere |
---|
154 | real :: MONS_coeffN ! coeff for northern hemisphere |
---|
155 | ! real,parameter :: icedepthmin=1.e-3 ! Ice begins at most at that depth |
---|
156 | |
---|
157 | ! added by RW for test |
---|
158 | real pmean, phi0 |
---|
159 | |
---|
160 | ! added by BC for equilibrium temperature startup |
---|
161 | real teque |
---|
162 | |
---|
163 | ! added by BC for cloud fraction setup |
---|
164 | REAL hice(ngridmx),cloudfrac(ngridmx,nlayermx) |
---|
165 | REAL totalfrac(ngridmx) |
---|
166 | |
---|
167 | ! added by RW for nuketharsis |
---|
168 | real fact1 |
---|
169 | real fact2 |
---|
170 | |
---|
171 | |
---|
172 | c sortie visu pour les champs dynamiques |
---|
173 | c--------------------------------------- |
---|
174 | ! INTEGER :: visuid |
---|
175 | ! real :: time_step,t_ops,t_wrt |
---|
176 | ! CHARACTER*80 :: visu_file |
---|
177 | |
---|
178 | ! cpp = 744.499 ! for Mars, instead of 1004.70885 (Earth) |
---|
179 | ! preff = 610. ! for Mars, instead of 101325. (Earth) |
---|
180 | ! pa = 20 ! for Mars, instead of 500 (Earth) |
---|
181 | cpp = 0. |
---|
182 | preff = 0. |
---|
183 | pa = 0. ! to ensure disaster rather than minor error if we don`t |
---|
184 | ! make deliberate choice of these values elsewhere. |
---|
185 | |
---|
186 | c======================================================================= |
---|
187 | c Choice of the start file(s) to use |
---|
188 | c======================================================================= |
---|
189 | |
---|
190 | write(*,*) 'From which kind of files do you want to create new', |
---|
191 | . 'start and startfi files' |
---|
192 | write(*,*) ' 0 - from a file start_archive' |
---|
193 | write(*,*) ' 1 - from files start and startfi' |
---|
194 | |
---|
195 | c----------------------------------------------------------------------- |
---|
196 | c Open file(s) to modify (start or start_archive) |
---|
197 | c----------------------------------------------------------------------- |
---|
198 | |
---|
199 | DO |
---|
200 | read(*,*,iostat=ierr) choix_1 |
---|
201 | if ((choix_1 /= 0).OR.(choix_1 /=1)) EXIT |
---|
202 | ENDDO |
---|
203 | |
---|
204 | c Open start_archive |
---|
205 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
206 | if (choix_1.eq.0) then |
---|
207 | |
---|
208 | write(*,*) 'Creating start files from:' |
---|
209 | write(*,*) './start_archive.nc' |
---|
210 | write(*,*) |
---|
211 | fichnom = 'start_archive.nc' |
---|
212 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid) |
---|
213 | IF (ierr.NE.NF_NOERR) THEN |
---|
214 | write(6,*)' Problem opening file:',fichnom |
---|
215 | write(6,*)' ierr = ', ierr |
---|
216 | CALL ABORT |
---|
217 | ENDIF |
---|
218 | tab0 = 50 |
---|
219 | Lmodif = 1 |
---|
220 | |
---|
221 | c OR open start and startfi files |
---|
222 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
223 | else |
---|
224 | write(*,*) 'Creating start files from:' |
---|
225 | write(*,*) './start.nc and ./startfi.nc' |
---|
226 | write(*,*) |
---|
227 | fichnom = 'start.nc' |
---|
228 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid_dyn) |
---|
229 | IF (ierr.NE.NF_NOERR) THEN |
---|
230 | write(6,*)' Problem opening file:',fichnom |
---|
231 | write(6,*)' ierr = ', ierr |
---|
232 | CALL ABORT |
---|
233 | ENDIF |
---|
234 | |
---|
235 | fichnom = 'startfi.nc' |
---|
236 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid_fi) |
---|
237 | IF (ierr.NE.NF_NOERR) THEN |
---|
238 | write(6,*)' Problem opening file:',fichnom |
---|
239 | write(6,*)' ierr = ', ierr |
---|
240 | CALL ABORT |
---|
241 | ENDIF |
---|
242 | |
---|
243 | tab0 = 0 |
---|
244 | Lmodif = 0 |
---|
245 | |
---|
246 | endif |
---|
247 | |
---|
248 | c----------------------------------------------------------------------- |
---|
249 | c Lecture du tableau des parametres du run (pour la dynamique) |
---|
250 | c----------------------------------------------------------------------- |
---|
251 | |
---|
252 | if (choix_1.eq.0) then |
---|
253 | |
---|
254 | write(*,*) 'reading tab_cntrl START_ARCHIVE' |
---|
255 | c |
---|
256 | ierr = NF_INQ_VARID (nid, "controle", nvarid) |
---|
257 | #ifdef NC_DOUBLE |
---|
258 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) |
---|
259 | #else |
---|
260 | ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) |
---|
261 | #endif |
---|
262 | c |
---|
263 | else if (choix_1.eq.1) then |
---|
264 | |
---|
265 | write(*,*) 'reading tab_cntrl START' |
---|
266 | c |
---|
267 | ierr = NF_INQ_VARID (nid_dyn, "controle", nvarid) |
---|
268 | #ifdef NC_DOUBLE |
---|
269 | ierr = NF_GET_VAR_DOUBLE(nid_dyn, nvarid, tab_cntrl) |
---|
270 | #else |
---|
271 | ierr = NF_GET_VAR_REAL(nid_dyn, nvarid, tab_cntrl) |
---|
272 | #endif |
---|
273 | c |
---|
274 | write(*,*) 'reading tab_cntrl STARTFI' |
---|
275 | c |
---|
276 | ierr = NF_INQ_VARID (nid_fi, "controle", nvarid) |
---|
277 | #ifdef NC_DOUBLE |
---|
278 | ierr = NF_GET_VAR_DOUBLE(nid_fi, nvarid, tab_cntrl_bis) |
---|
279 | #else |
---|
280 | ierr = NF_GET_VAR_REAL(nid_fi, nvarid, tab_cntrl_bis) |
---|
281 | #endif |
---|
282 | c |
---|
283 | do i=1,50 |
---|
284 | tab_cntrl(i+50)=tab_cntrl_bis(i) |
---|
285 | enddo |
---|
286 | write(*,*) 'printing tab_cntrl', tab_cntrl |
---|
287 | do i=1,100 |
---|
288 | write(*,*) i,tab_cntrl(i) |
---|
289 | enddo |
---|
290 | |
---|
291 | endif |
---|
292 | c----------------------------------------------------------------------- |
---|
293 | c Initialisation des constantes dynamique |
---|
294 | c----------------------------------------------------------------------- |
---|
295 | |
---|
296 | kappa = tab_cntrl(9) |
---|
297 | etot0 = tab_cntrl(12) |
---|
298 | ptot0 = tab_cntrl(13) |
---|
299 | ztot0 = tab_cntrl(14) |
---|
300 | stot0 = tab_cntrl(15) |
---|
301 | ang0 = tab_cntrl(16) |
---|
302 | write(*,*) "Newstart: kappa,etot0,ptot0,ztot0,stot0,ang0" |
---|
303 | write(*,*) kappa,etot0,ptot0,ztot0,stot0,ang0 |
---|
304 | |
---|
305 | ! for vertical coordinate |
---|
306 | preff=tab_cntrl(18) ! reference surface pressure |
---|
307 | pa=tab_cntrl(17) ! reference pressure at which coord is purely pressure |
---|
308 | !NB: in start_archive files tab_cntrl(17)=tab_cntrl(18)=0 |
---|
309 | write(*,*) "Newstart: preff=",preff," pa=",pa |
---|
310 | yes=' ' |
---|
311 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
312 | write(*,*) "Change the values of preff and pa? (y/n)" |
---|
313 | read(*,fmt='(a)') yes |
---|
314 | end do |
---|
315 | if (yes.eq.'y') then |
---|
316 | write(*,*)"New value of reference surface pressure preff?" |
---|
317 | write(*,*)" (for Mars, typically preff=610)" |
---|
318 | read(*,*) preff |
---|
319 | write(*,*)"New value of reference pressure pa for purely" |
---|
320 | write(*,*)"pressure levels (for hybrid coordinates)?" |
---|
321 | write(*,*)" (for Mars, typically pa=20)" |
---|
322 | read(*,*) pa |
---|
323 | endif |
---|
324 | c----------------------------------------------------------------------- |
---|
325 | c Lecture du tab_cntrl et initialisation des constantes physiques |
---|
326 | c - pour start: Lmodif = 0 => pas de modifications possibles |
---|
327 | c (modif dans le tabfi de readfi + loin) |
---|
328 | c - pour start_archive: Lmodif = 1 => modifications possibles |
---|
329 | c----------------------------------------------------------------------- |
---|
330 | if (choix_1.eq.0) then |
---|
331 | call tabfi (nid,Lmodif,tab0,day_ini,lllm,p_rad, |
---|
332 | . p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) |
---|
333 | else if (choix_1.eq.1) then |
---|
334 | call tabfi (nid_fi,Lmodif,tab0,day_ini,lllm,p_rad, |
---|
335 | . p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) |
---|
336 | endif |
---|
337 | |
---|
338 | rad = p_rad |
---|
339 | omeg = p_omeg |
---|
340 | g = p_g |
---|
341 | cpp = p_cpp |
---|
342 | mugaz = p_mugaz |
---|
343 | daysec = p_daysec |
---|
344 | |
---|
345 | kappa = 8.314*1000./(p_mugaz*p_cpp) ! added by RDW |
---|
346 | |
---|
347 | |
---|
348 | c======================================================================= |
---|
349 | c INITIALISATIONS DIVERSES |
---|
350 | c======================================================================= |
---|
351 | ! Load tracer names: |
---|
352 | call iniadvtrac(nq,numvanle) |
---|
353 | ! tnom(:) now contains tracer names |
---|
354 | ! Initialize global tracer indexes (stored in tracer.h) |
---|
355 | call initracer() |
---|
356 | ! Load parameters from run.def file |
---|
357 | CALL defrun_new( 99, .TRUE. ) |
---|
358 | CALL iniconst |
---|
359 | CALL inigeom |
---|
360 | idum=-1 |
---|
361 | idum=0 |
---|
362 | |
---|
363 | c Initialisation coordonnees /aires |
---|
364 | c ------------------------------- |
---|
365 | ! Note: rlatu(:) and rlonv(:) are commons defined in "comgeom.h" |
---|
366 | ! rlatu() and rlonv() are given in radians |
---|
367 | latfi(1)=rlatu(1) |
---|
368 | lonfi(1)=0. |
---|
369 | DO j=2,jjm |
---|
370 | DO i=1,iim |
---|
371 | latfi((j-2)*iim+1+i)=rlatu(j) |
---|
372 | lonfi((j-2)*iim+1+i)=rlonv(i) |
---|
373 | ENDDO |
---|
374 | ENDDO |
---|
375 | latfi(ngridmx)=rlatu(jjp1) |
---|
376 | lonfi(ngridmx)=0. |
---|
377 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) |
---|
378 | |
---|
379 | c======================================================================= |
---|
380 | c lecture topographie, albedo, inertie thermique, relief sous-maille |
---|
381 | c======================================================================= |
---|
382 | |
---|
383 | if (choix_1.ne.1) then ! pour ne pas avoir besoin du fichier |
---|
384 | ! surface.dat dans le cas des start |
---|
385 | |
---|
386 | c do while((relief(1:3).ne.'mol').AND.(relief(1:3).ne.'pla')) |
---|
387 | c write(*,*) |
---|
388 | c write(*,*) 'choix du relief (mola,pla)' |
---|
389 | c write(*,*) '(Topographie MGS MOLA, plat)' |
---|
390 | c read(*,fmt='(a3)') relief |
---|
391 | relief="mola" |
---|
392 | c enddo |
---|
393 | |
---|
394 | CALL datareadnc(relief,phis,alb,surfith,zmeaS,zstdS,zsigS,zgamS, |
---|
395 | . ztheS) |
---|
396 | |
---|
397 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
398 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,surfith,surfithfi) |
---|
399 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
400 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,zmeaS,zmea) |
---|
401 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,zstdS,zstd) |
---|
402 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,zsigS,zsig) |
---|
403 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,zgamS,zgam) |
---|
404 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,ztheS,zthe) |
---|
405 | |
---|
406 | endif ! of if (choix_1.ne.1) |
---|
407 | |
---|
408 | |
---|
409 | c======================================================================= |
---|
410 | c Lecture des fichiers (start ou start_archive) |
---|
411 | c======================================================================= |
---|
412 | |
---|
413 | if (choix_1.eq.0) then |
---|
414 | |
---|
415 | write(*,*) 'Reading file START_ARCHIVE' |
---|
416 | CALL lect_start_archive(date,tsurf,tsoil,emis,q2, |
---|
417 | . t,ucov,vcov,ps,teta,phisold_newgrid,q,qsurf, |
---|
418 | & surfith,nid) |
---|
419 | write(*,*) "OK, read start_archive file" |
---|
420 | ! copy soil thermal inertia |
---|
421 | ithfi(:,:)=inertiedat(:,:) |
---|
422 | |
---|
423 | ierr= NF_CLOSE(nid) |
---|
424 | |
---|
425 | else if (choix_1.eq.1) then ! c'est l'appel a tabfi de phyeta0 qui |
---|
426 | ! permet de changer les valeurs du |
---|
427 | ! tab_cntrl Lmodif=1 |
---|
428 | tab0=0 |
---|
429 | Lmodif=1 ! Lmodif set to 1 to allow modifications in phyeta0 |
---|
430 | write(*,*) 'Reading file START' |
---|
431 | fichnom = 'start.nc' |
---|
432 | CALL dynetat0(fichnom,nqmx,vcov,ucov,teta,q,masse, |
---|
433 | . ps,phis,time) |
---|
434 | |
---|
435 | write(*,*) 'Reading file STARTFI' |
---|
436 | fichnom = 'startfi.nc' |
---|
437 | CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqmx, |
---|
438 | . day_ini,time, |
---|
439 | . tsurf,tsoil,emis,q2,qsurf, !) ! temporary modif by RDW |
---|
440 | . cloudfrac,totalfrac,hice) |
---|
441 | |
---|
442 | ! copy albedo and soil thermal inertia |
---|
443 | do i=1,ngridmx |
---|
444 | albfi(i) = albedodat(i) |
---|
445 | do j=1,nsoilmx |
---|
446 | ithfi(i,j) = inertiedat(i,j) |
---|
447 | enddo |
---|
448 | ! build a surfithfi(:) using 1st layer of ithfi(:), which might |
---|
449 | ! be neede later on if reinitializing soil thermal inertia |
---|
450 | surfithfi(i)=ithfi(i,1) |
---|
451 | enddo |
---|
452 | |
---|
453 | else |
---|
454 | CALL exit(1) |
---|
455 | endif |
---|
456 | |
---|
457 | dtvr = daysec/FLOAT(day_step) |
---|
458 | dtphys = dtvr * FLOAT(iphysiq) |
---|
459 | |
---|
460 | c======================================================================= |
---|
461 | c |
---|
462 | c======================================================================= |
---|
463 | |
---|
464 | do ! infinite loop on list of changes |
---|
465 | |
---|
466 | write(*,*) |
---|
467 | write(*,*) |
---|
468 | write(*,*) 'List of possible changes :' |
---|
469 | write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
470 | write(*,*) |
---|
471 | write(*,*) 'flat : no topography ("aquaplanet")' |
---|
472 | write(*,*) 'nuketharsis : no Tharsis bulge' |
---|
473 | write(*,*) 'bilball : uniform albedo and thermal inertia' |
---|
474 | write(*,*) 'coldspole : cold subsurface and high albedo at S.pole' |
---|
475 | write(*,*) 'qname : change tracer name' |
---|
476 | write(*,*) 'q=0 : ALL tracer =zero' |
---|
477 | write(*,*) 'q=x : give a specific uniform value to one tracer' |
---|
478 | write(*,*) 'ini_q : tracers initialisation for chemistry, water an |
---|
479 | $d ice ' |
---|
480 | write(*,*) 'ini_q-H2O : tracers initialisation for chemistry and |
---|
481 | $ice ' |
---|
482 | write(*,*) 'ini_q-iceH2O : tracers initialisation for chemistry on |
---|
483 | $ly ' |
---|
484 | write(*,*) 'noglacier : Remove tropical H2O ice if |lat|<45' |
---|
485 | write(*,*) 'watercapn : H20 ice on permanent N polar cap ' |
---|
486 | write(*,*) 'watercaps : H20 ice on permanent S polar cap ' |
---|
487 | write(*,*) 'noacglac : H2O ice across Noachis Terra' |
---|
488 | write(*,*) 'oborealis : H2O ice across Vastitas Borealis' |
---|
489 | write(*,*) 'iceball : Thick ice layer all over surface' |
---|
490 | write(*,*) 'wetstart : start with a wet atmosphere' |
---|
491 | write(*,*) 'isotherm : Isothermal Temperatures, wind set to zero' |
---|
492 | write(*,*) 'radequi : Earth-like radiative equilibrium temperature |
---|
493 | $ profile (lat-alt) and winds set to zero' |
---|
494 | write(*,*) 'coldstart : Start X K above the CO2 frost point and |
---|
495 | $set wind to zero (assumes 100% CO2)' |
---|
496 | write(*,*) 'co2ice=0 : remove CO2 polar cap' |
---|
497 | write(*,*) 'ptot : change total pressure' |
---|
498 | write(*,*) 'emis : change surface emissivity' |
---|
499 | write(*,*) 'therm_ini_s : Set soil thermal inertia to reference sur |
---|
500 | &face values' |
---|
501 | ! write(*,*) 'subsoilice_n : Put deep underground ice layer in northe |
---|
502 | ! &rn hemisphere' |
---|
503 | ! write(*,*) 'subsoilice_s : Put deep underground ice layer in southe |
---|
504 | ! &rn hemisphere' |
---|
505 | ! write(*,*) 'mons_ice : Put underground ice layer according to MONS- |
---|
506 | ! &derived data' |
---|
507 | |
---|
508 | write(*,*) |
---|
509 | write(*,*) 'Change to perform ?' |
---|
510 | write(*,*) ' (enter keyword or return to end)' |
---|
511 | write(*,*) |
---|
512 | |
---|
513 | read(*,fmt='(a20)') modif |
---|
514 | if (modif(1:1) .eq. ' ') exit ! exit loop on changes |
---|
515 | |
---|
516 | write(*,*) |
---|
517 | write(*,*) trim(modif) , ' : ' |
---|
518 | |
---|
519 | c 'flat : no topography ("aquaplanet")' |
---|
520 | c ------------------------------------- |
---|
521 | if (modif(1:len_trim(modif)) .eq. 'flat') then |
---|
522 | c set topo to zero |
---|
523 | CALL initial0(ip1jmp1,z_reel) |
---|
524 | CALL multscal(ip1jmp1,z_reel,g,phis) |
---|
525 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
526 | write(*,*) 'topography set to zero.' |
---|
527 | write(*,*) 'WARNING : the subgrid topography parameters', |
---|
528 | & ' were not set to zero ! => set calllott to F' |
---|
529 | |
---|
530 | c Choice of surface pressure |
---|
531 | yes=' ' |
---|
532 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
533 | write(*,*) 'Do you wish to choose homogeneous surface', |
---|
534 | & 'pressure (y) or let newstart interpolate ', |
---|
535 | & ' the previous field (n)?' |
---|
536 | read(*,fmt='(a)') yes |
---|
537 | end do |
---|
538 | if (yes.eq.'y') then |
---|
539 | flagps0=.true. |
---|
540 | write(*,*) 'New value for ps (Pa) ?' |
---|
541 | 201 read(*,*,iostat=ierr) patm |
---|
542 | if(ierr.ne.0) goto 201 |
---|
543 | write(*,*) |
---|
544 | write(*,*) ' new ps everywhere (Pa) = ', patm |
---|
545 | write(*,*) |
---|
546 | do j=1,jjp1 |
---|
547 | do i=1,iip1 |
---|
548 | ps(i,j)=patm |
---|
549 | enddo |
---|
550 | enddo |
---|
551 | end if |
---|
552 | |
---|
553 | c 'nuketharsis : no tharsis bulge for Early Mars' |
---|
554 | c --------------------------------------------- |
---|
555 | else if (modif(1:len_trim(modif)) .eq. 'nuketharsis') then |
---|
556 | |
---|
557 | DO j=1,jjp1 |
---|
558 | DO i=1,iim |
---|
559 | ig=1+(j-2)*iim +i |
---|
560 | if(j.eq.1) ig=1 |
---|
561 | if(j.eq.jjp1) ig=ngridmx |
---|
562 | |
---|
563 | fact1=(((rlonv(i)*180./pi)+100)**2 + |
---|
564 | & (rlatu(j)*180./pi)**2)/65**2 |
---|
565 | fact2=exp( -fact1**2.5 ) |
---|
566 | |
---|
567 | phis(i,j) = phis(i,j) - (phis(i,j)+4000.*g)*fact2 |
---|
568 | |
---|
569 | ! if(phis(i,j).gt.2500.*g)then |
---|
570 | ! if(rlatu(j)*180./pi.gt.-80.)then ! avoid chopping south polar cap |
---|
571 | ! phis(i,j)=2500.*g |
---|
572 | ! endif |
---|
573 | ! endif |
---|
574 | |
---|
575 | ENDDO |
---|
576 | ENDDO |
---|
577 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
578 | |
---|
579 | |
---|
580 | c bilball : uniform albedo, thermal inertia |
---|
581 | c ----------------------------------------- |
---|
582 | else if (modif(1:len_trim(modif)) .eq. 'bilball') then |
---|
583 | write(*,*) 'constante albedo and iner.therm:' |
---|
584 | write(*,*) 'New value for albedo (ex: 0.25) ?' |
---|
585 | 101 read(*,*,iostat=ierr) alb_bb |
---|
586 | if(ierr.ne.0) goto 101 |
---|
587 | write(*,*) |
---|
588 | write(*,*) ' uniform albedo (new value):',alb_bb |
---|
589 | write(*,*) |
---|
590 | |
---|
591 | write(*,*) 'New value for thermal inertia (eg: 247) ?' |
---|
592 | 102 read(*,*,iostat=ierr) ith_bb |
---|
593 | if(ierr.ne.0) goto 102 |
---|
594 | write(*,*) 'uniform thermal inertia (new value):',ith_bb |
---|
595 | DO j=1,jjp1 |
---|
596 | DO i=1,iip1 |
---|
597 | alb(i,j) = alb_bb ! albedo |
---|
598 | do isoil=1,nsoilmx |
---|
599 | ith(i,j,isoil) = ith_bb ! thermal inertia |
---|
600 | enddo |
---|
601 | END DO |
---|
602 | END DO |
---|
603 | ! CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,ith,ithfi) |
---|
604 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
605 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
606 | |
---|
607 | c coldspole : sous-sol de la calotte sud toujours froid |
---|
608 | c ----------------------------------------------------- |
---|
609 | else if (modif(1:len_trim(modif)) .eq. 'coldspole') then |
---|
610 | write(*,*)'new value for the subsurface temperature', |
---|
611 | & ' beneath the permanent southern polar cap ? (eg: 141 K)' |
---|
612 | 103 read(*,*,iostat=ierr) tsud |
---|
613 | if(ierr.ne.0) goto 103 |
---|
614 | write(*,*) |
---|
615 | write(*,*) ' new value of the subsurface temperature:',tsud |
---|
616 | c nouvelle temperature sous la calotte permanente |
---|
617 | do l=2,nsoilmx |
---|
618 | tsoil(ngridmx,l) = tsud |
---|
619 | end do |
---|
620 | |
---|
621 | |
---|
622 | write(*,*)'new value for the albedo', |
---|
623 | & 'of the permanent southern polar cap ? (eg: 0.75)' |
---|
624 | 104 read(*,*,iostat=ierr) albsud |
---|
625 | if(ierr.ne.0) goto 104 |
---|
626 | write(*,*) |
---|
627 | |
---|
628 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
629 | c Option 1: only the albedo of the pole is modified : |
---|
630 | albfi(ngridmx)=albsud |
---|
631 | write(*,*) 'ig=',ngridmx,' albedo perennial cap ', |
---|
632 | & albfi(ngridmx) |
---|
633 | |
---|
634 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
635 | c Option 2 A haute resolution : coordonnee de la vrai calotte ~ |
---|
636 | c DO j=1,jjp1 |
---|
637 | c DO i=1,iip1 |
---|
638 | c ig=1+(j-2)*iim +i |
---|
639 | c if(j.eq.1) ig=1 |
---|
640 | c if(j.eq.jjp1) ig=ngridmx |
---|
641 | c if ((rlatu(j)*180./pi.lt.-84.).and. |
---|
642 | c & (rlatu(j)*180./pi.gt.-91.).and. |
---|
643 | c & (rlonv(i)*180./pi.gt.-91.).and. |
---|
644 | c & (rlonv(i)*180./pi.lt.0.)) then |
---|
645 | cc albedo de la calotte permanente fixe a albsud |
---|
646 | c alb(i,j)=albsud |
---|
647 | c write(*,*) 'lat=',rlatu(j)*180./pi, |
---|
648 | c & ' lon=',rlonv(i)*180./pi |
---|
649 | cc fin de la condition sur les limites de la calotte permanente |
---|
650 | c end if |
---|
651 | c ENDDO |
---|
652 | c ENDDO |
---|
653 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
654 | |
---|
655 | c CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
656 | |
---|
657 | |
---|
658 | c ptot : Modification of the total pressure: ice + current atmosphere |
---|
659 | c ------------------------------------------------------------------- |
---|
660 | else if (modif(1:len_trim(modif)).eq.'ptot') then |
---|
661 | |
---|
662 | ! check if we have a co2_ice surface tracer: |
---|
663 | if (igcm_co2_ice.eq.0) then |
---|
664 | write(*,*) " No surface CO2 ice !" |
---|
665 | write(*,*) " only atmospheric pressure will be considered!" |
---|
666 | endif |
---|
667 | c calcul de la pression totale glace + atm actuelle |
---|
668 | patm=0. |
---|
669 | airetot=0. |
---|
670 | pcap=0. |
---|
671 | DO j=1,jjp1 |
---|
672 | DO i=1,iim |
---|
673 | ig=1+(j-2)*iim +i |
---|
674 | if(j.eq.1) ig=1 |
---|
675 | if(j.eq.jjp1) ig=ngridmx |
---|
676 | patm = patm + ps(i,j)*aire(i,j) |
---|
677 | airetot= airetot + aire(i,j) |
---|
678 | if (igcm_co2_ice.ne.0) then |
---|
679 | !pcap = pcap + aire(i,j)*co2ice(ig)*g |
---|
680 | pcap = pcap + aire(i,j)*qsurf(ig,igcm_co2_ice)*g |
---|
681 | endif |
---|
682 | ENDDO |
---|
683 | ENDDO |
---|
684 | ptoto = pcap + patm |
---|
685 | |
---|
686 | print*,'Current total pressure at surface (co2 ice + atm) ', |
---|
687 | & ptoto/airetot |
---|
688 | |
---|
689 | print*,'new value?' |
---|
690 | read(*,*) ptotn |
---|
691 | ptotn=ptotn*airetot |
---|
692 | patmn=ptotn-pcap |
---|
693 | print*,'ptoto,patm,ptotn,patmn' |
---|
694 | print*,ptoto,patm,ptotn,patmn |
---|
695 | print*,'Mult. factor for pressure (atm only)', patmn/patm |
---|
696 | do j=1,jjp1 |
---|
697 | do i=1,iip1 |
---|
698 | ps(i,j)=ps(i,j)*patmn/patm |
---|
699 | enddo |
---|
700 | enddo |
---|
701 | |
---|
702 | |
---|
703 | |
---|
704 | c Correction pour la conservation des traceurs |
---|
705 | yes=' ' |
---|
706 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
707 | write(*,*) 'Do you wish to conserve tracer total mass (y)', |
---|
708 | & ' or tracer mixing ratio (n) ?' |
---|
709 | read(*,fmt='(a)') yes |
---|
710 | end do |
---|
711 | |
---|
712 | if (yes.eq.'y') then |
---|
713 | write(*,*) 'OK : conservation of tracer total mass' |
---|
714 | DO iq =1, nqmx |
---|
715 | DO l=1,llm |
---|
716 | DO j=1,jjp1 |
---|
717 | DO i=1,iip1 |
---|
718 | q(i,j,l,iq)=q(i,j,l,iq)*patm/patmn |
---|
719 | ENDDO |
---|
720 | ENDDO |
---|
721 | ENDDO |
---|
722 | ENDDO |
---|
723 | else |
---|
724 | write(*,*) 'OK : conservation of tracer mixing ratio' |
---|
725 | end if |
---|
726 | |
---|
727 | c Correction pour la pression au niveau de la mer |
---|
728 | yes=' ' |
---|
729 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
730 | write(*,*) 'Do you wish fix pressure at sea level (y)', |
---|
731 | & ' or not (n) ?' |
---|
732 | read(*,fmt='(a)') yes |
---|
733 | end do |
---|
734 | |
---|
735 | if (yes.eq.'y') then |
---|
736 | write(*,*) 'Value?' |
---|
737 | read(*,*,iostat=ierr) psea |
---|
738 | DO i=1,iip1 |
---|
739 | DO j=1,jjp1 |
---|
740 | ps(i,j)=psea |
---|
741 | |
---|
742 | ENDDO |
---|
743 | ENDDO |
---|
744 | write(*,*) 'psea=',psea |
---|
745 | else |
---|
746 | write(*,*) 'no' |
---|
747 | end if |
---|
748 | |
---|
749 | |
---|
750 | c emis : change surface emissivity (added by RW) |
---|
751 | c ---------------------------------------------- |
---|
752 | else if (trim(modif).eq.'emis') then |
---|
753 | |
---|
754 | print*,'new value?' |
---|
755 | read(*,*) emisread |
---|
756 | |
---|
757 | do i=1,ngridmx |
---|
758 | emis(i)=emisread |
---|
759 | enddo |
---|
760 | |
---|
761 | c qname : change tracer name |
---|
762 | c -------------------------- |
---|
763 | else if (trim(modif).eq.'qname') then |
---|
764 | yes='y' |
---|
765 | do while (yes.eq.'y') |
---|
766 | write(*,*) 'Which tracer name do you want to change ?' |
---|
767 | do iq=1,nqmx |
---|
768 | write(*,'(i3,a3,a20)')iq,' : ',trim(tnom(iq)) |
---|
769 | enddo |
---|
770 | write(*,'(a35,i3)') |
---|
771 | & '(enter tracer number; between 1 and ',nqmx |
---|
772 | write(*,*)' or any other value to quit this option)' |
---|
773 | read(*,*) iq |
---|
774 | if ((iq.ge.1).and.(iq.le.nqmx)) then |
---|
775 | write(*,*)'Change tracer name ',trim(tnom(iq)),' to ?' |
---|
776 | read(*,*) txt |
---|
777 | tnom(iq)=txt |
---|
778 | write(*,*)'Do you want to change another tracer name (y/n)?' |
---|
779 | read(*,'(a)') yes |
---|
780 | else |
---|
781 | ! inapropiate value of iq; quit this option |
---|
782 | yes='n' |
---|
783 | endif ! of if ((iq.ge.1).and.(iq.le.nqmx)) |
---|
784 | enddo ! of do while (yes.ne.'y') |
---|
785 | |
---|
786 | c q=0 : set tracers to zero |
---|
787 | c ------------------------- |
---|
788 | else if (modif(1:len_trim(modif)).eq.'q=0') then |
---|
789 | c mise a 0 des q (traceurs) |
---|
790 | write(*,*) 'Tracers set to 0 (1.E-30 in fact)' |
---|
791 | DO iq =1, nqmx |
---|
792 | DO l=1,llm |
---|
793 | DO j=1,jjp1 |
---|
794 | DO i=1,iip1 |
---|
795 | q(i,j,l,iq)=1.e-30 |
---|
796 | ENDDO |
---|
797 | ENDDO |
---|
798 | ENDDO |
---|
799 | ENDDO |
---|
800 | |
---|
801 | c set surface tracers to zero |
---|
802 | DO iq =1, nqmx |
---|
803 | DO ig=1,ngridmx |
---|
804 | qsurf(ig,iq)=0. |
---|
805 | ENDDO |
---|
806 | ENDDO |
---|
807 | |
---|
808 | c q=x : initialise tracer manually |
---|
809 | c -------------------------------- |
---|
810 | else if (modif(1:len_trim(modif)).eq.'q=x') then |
---|
811 | write(*,*) 'Which tracer do you want to modify ?' |
---|
812 | do iq=1,nqmx |
---|
813 | write(*,*)iq,' : ',trim(tnom(iq)) |
---|
814 | enddo |
---|
815 | write(*,*) '(choose between 1 and ',nqmx,')' |
---|
816 | read(*,*) iq |
---|
817 | write(*,*)'mixing ratio of tracer ',trim(tnom(iq)), |
---|
818 | & ' ? (kg/kg)' |
---|
819 | read(*,*) val |
---|
820 | DO l=1,llm |
---|
821 | DO j=1,jjp1 |
---|
822 | DO i=1,iip1 |
---|
823 | q(i,j,l,iq)=val |
---|
824 | ENDDO |
---|
825 | ENDDO |
---|
826 | ENDDO |
---|
827 | write(*,*) 'SURFACE value of tracer ',trim(tnom(iq)), |
---|
828 | & ' ? (kg/m2)' |
---|
829 | read(*,*) val |
---|
830 | DO ig=1,ngridmx |
---|
831 | qsurf(ig,iq)=val |
---|
832 | ENDDO |
---|
833 | |
---|
834 | c ini_q : Initialize tracers for chemistry |
---|
835 | c ----------------------------------------------- |
---|
836 | else if (modif(1:len_trim(modif)) .eq. 'ini_q') then |
---|
837 | c For more than 32 layers, possible to initiate thermosphere only |
---|
838 | thermo=0 |
---|
839 | yes=' ' |
---|
840 | if (llm.gt.32) then |
---|
841 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
842 | write(*,*)'', |
---|
843 | & 'initialisation for thermosphere only? (y/n)' |
---|
844 | read(*,fmt='(a)') yes |
---|
845 | if (yes.eq.'y') then |
---|
846 | thermo=1 |
---|
847 | else |
---|
848 | thermo=0 |
---|
849 | endif |
---|
850 | enddo |
---|
851 | endif |
---|
852 | |
---|
853 | c call inichim_newstart(q,ps,sig,nqmx,latfi,lonfi,airefi, |
---|
854 | c $ thermo,qsurf) |
---|
855 | write(*,*) 'Chemical species initialized' |
---|
856 | |
---|
857 | if (thermo.eq.0) then |
---|
858 | c mise a 0 des qsurf (traceurs a la surface) |
---|
859 | DO iq =1, nqmx |
---|
860 | DO ig=1,ngridmx |
---|
861 | qsurf(ig,iq)=0. |
---|
862 | ENDDO |
---|
863 | ENDDO |
---|
864 | endif |
---|
865 | |
---|
866 | c ini_q-H2O : as above except for the water vapour tracer |
---|
867 | c ------------------------------------------------------ |
---|
868 | else if (modif(1:len_trim(modif)) .eq. 'ini_q-H2O') then |
---|
869 | ! for more than 32 layers, possible to initiate thermosphere only |
---|
870 | thermo=0 |
---|
871 | yes=' ' |
---|
872 | if(llm.gt.32) then |
---|
873 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
874 | write(*,*)'', |
---|
875 | & 'initialisation for thermosphere only? (y/n)' |
---|
876 | read(*,fmt='(a)') yes |
---|
877 | if (yes.eq.'y') then |
---|
878 | thermo=1 |
---|
879 | else |
---|
880 | thermo=0 |
---|
881 | endif |
---|
882 | enddo |
---|
883 | endif |
---|
884 | c call inichim_newstart(q,ps,sig,nqmx-1,latfi,lonfi,airefi, |
---|
885 | c $ thermo,qsurf) |
---|
886 | c write(*,*) 'Initialized chem. species exept last (H2O)' |
---|
887 | |
---|
888 | if (thermo.eq.0) then |
---|
889 | c set surface tracers to zero, except water ice |
---|
890 | DO iq =1, nqmx |
---|
891 | if (iq.ne.igcm_h2o_ice) then |
---|
892 | DO ig=1,ngridmx |
---|
893 | qsurf(ig,iq)=0. |
---|
894 | ENDDO |
---|
895 | endif |
---|
896 | ENDDO |
---|
897 | endif |
---|
898 | |
---|
899 | c ini_q-iceH2O : as above exept for ice et H2O |
---|
900 | c ----------------------------------------------- |
---|
901 | else if (modif(1:len_trim(modif)) .eq. 'ini_q-iceH2O') then |
---|
902 | c For more than 32 layers, possible to initiate thermosphere only |
---|
903 | thermo=0 |
---|
904 | yes=' ' |
---|
905 | if(llm.gt.32) then |
---|
906 | do while ((yes.ne.'y').and.(yes.ne.'n')) |
---|
907 | write(*,*)'', |
---|
908 | & 'initialisation for thermosphere only? (y/n)' |
---|
909 | read(*,fmt='(a)') yes |
---|
910 | if (yes.eq.'y') then |
---|
911 | thermo=1 |
---|
912 | else |
---|
913 | thermo=0 |
---|
914 | endif |
---|
915 | enddo |
---|
916 | endif |
---|
917 | |
---|
918 | c call inichim_newstart(q,ps,sig,nqmx-2,latfi,lonfi,airefi, |
---|
919 | c $ thermo,qsurf) |
---|
920 | c write(*,*) 'Initialized chem. species exept ice and H2O' |
---|
921 | |
---|
922 | if (thermo.eq.0) then |
---|
923 | c set surface tracers to zero, except water ice |
---|
924 | DO iq =1, nqmx |
---|
925 | if (iq.ne.igcm_h2o_ice) then |
---|
926 | DO ig=1,ngridmx |
---|
927 | qsurf(ig,iq)=0. |
---|
928 | ENDDO |
---|
929 | endif |
---|
930 | ENDDO |
---|
931 | endif |
---|
932 | |
---|
933 | c wetstart : wet atmosphere with a north to south gradient |
---|
934 | c -------------------------------------------------------- |
---|
935 | else if (modif(1:len_trim(modif)) .eq. 'wetstart') then |
---|
936 | ! check that there is indeed a water vapor tracer |
---|
937 | if (igcm_h2o_vap.eq.0) then |
---|
938 | write(*,*) "No water vapour tracer! Can't use this option" |
---|
939 | stop |
---|
940 | endif |
---|
941 | DO l=1,llm |
---|
942 | DO j=1,jjp1 |
---|
943 | DO i=1,iip1 |
---|
944 | q(i,j,l,igcm_h2o_vap)=150.e-6 * (rlatu(j)+pi/2.) / pi |
---|
945 | ENDDO |
---|
946 | ENDDO |
---|
947 | ENDDO |
---|
948 | |
---|
949 | write(*,*) 'Water mass mixing ratio at north pole=' |
---|
950 | * ,q(1,1,1,igcm_h2o_vap) |
---|
951 | write(*,*) '---------------------------south pole=' |
---|
952 | * ,q(1,jjp1,1,igcm_h2o_vap) |
---|
953 | |
---|
954 | c noglacier : remove tropical water ice (to initialize high res sim) |
---|
955 | c -------------------------------------------------- |
---|
956 | else if (modif(1:len_trim(modif)) .eq. 'noglacier') then |
---|
957 | if (igcm_h2o_ice.eq.0) then |
---|
958 | write(*,*) "No water ice tracer! Can't use this option" |
---|
959 | stop |
---|
960 | endif |
---|
961 | do ig=1,ngridmx |
---|
962 | j=(ig-2)/iim +2 |
---|
963 | if(ig.eq.1) j=1 |
---|
964 | write(*,*) 'OK: remove surface ice for |lat|<45' |
---|
965 | if (abs(rlatu(j)*180./pi).lt.45.) then |
---|
966 | qsurf(ig,igcm_h2o_ice)=0. |
---|
967 | end if |
---|
968 | end do |
---|
969 | |
---|
970 | |
---|
971 | c watercapn : H20 ice on permanent northern cap |
---|
972 | c -------------------------------------------------- |
---|
973 | else if (modif(1:len_trim(modif)) .eq. 'watercapn') then |
---|
974 | if (igcm_h2o_ice.eq.0) then |
---|
975 | write(*,*) "No water ice tracer! Can't use this option" |
---|
976 | stop |
---|
977 | endif |
---|
978 | |
---|
979 | DO j=1,jjp1 |
---|
980 | DO i=1,iim |
---|
981 | ig=1+(j-2)*iim +i |
---|
982 | if(j.eq.1) ig=1 |
---|
983 | if(j.eq.jjp1) ig=ngridmx |
---|
984 | |
---|
985 | if (rlatu(j)*180./pi.gt.80.) then |
---|
986 | qsurf(ig,igcm_h2o_ice)=3.4e3 |
---|
987 | !do isoil=1,nsoilmx |
---|
988 | ! ith(i,j,isoil) = 18000. ! thermal inertia |
---|
989 | !enddo |
---|
990 | write(*,*)' ==> Ice mesh North boundary (deg)= ', |
---|
991 | & rlatv(j-1)*180./pi |
---|
992 | end if |
---|
993 | ENDDO |
---|
994 | ENDDO |
---|
995 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
996 | |
---|
997 | c$$$ do ig=1,ngridmx |
---|
998 | c$$$ j=(ig-2)/iim +2 |
---|
999 | c$$$ if(ig.eq.1) j=1 |
---|
1000 | c$$$ if (rlatu(j)*180./pi.gt.80.) then |
---|
1001 | c$$$ |
---|
1002 | c$$$ qsurf(ig,igcm_h2o_ice)=1.e5 |
---|
1003 | c$$$ qsurf(ig,igcm_h2o_vap)=0.0!1.e5 |
---|
1004 | c$$$ |
---|
1005 | c$$$ write(*,*) 'ig=',ig,' H2O ice mass (kg/m2)= ', |
---|
1006 | c$$$ & qsurf(ig,igcm_h2o_ice) |
---|
1007 | c$$$ |
---|
1008 | c$$$ write(*,*)' ==> Ice mesh South boundary (deg)= ', |
---|
1009 | c$$$ & rlatv(j)*180./pi |
---|
1010 | c$$$ end if |
---|
1011 | c$$$ enddo |
---|
1012 | |
---|
1013 | c watercaps : H20 ice on permanent southern cap |
---|
1014 | c ------------------------------------------------- |
---|
1015 | else if (modif(1:len_trim(modif)) .eq. 'watercaps') then |
---|
1016 | if (igcm_h2o_ice.eq.0) then |
---|
1017 | write(*,*) "No water ice tracer! Can't use this option" |
---|
1018 | stop |
---|
1019 | endif |
---|
1020 | |
---|
1021 | DO j=1,jjp1 |
---|
1022 | DO i=1,iim |
---|
1023 | ig=1+(j-2)*iim +i |
---|
1024 | if(j.eq.1) ig=1 |
---|
1025 | if(j.eq.jjp1) ig=ngridmx |
---|
1026 | |
---|
1027 | if (rlatu(j)*180./pi.lt.-80.) then |
---|
1028 | qsurf(ig,igcm_h2o_ice)=3.4e3 |
---|
1029 | !do isoil=1,nsoilmx |
---|
1030 | ! ith(i,j,isoil) = 18000. ! thermal inertia |
---|
1031 | !enddo |
---|
1032 | write(*,*)' ==> Ice mesh South boundary (deg)= ', |
---|
1033 | & rlatv(j-1)*180./pi |
---|
1034 | end if |
---|
1035 | ENDDO |
---|
1036 | ENDDO |
---|
1037 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1038 | |
---|
1039 | c$$$ do ig=1,ngridmx |
---|
1040 | c$$$ j=(ig-2)/iim +2 |
---|
1041 | c$$$ if(ig.eq.1) j=1 |
---|
1042 | c$$$ if (rlatu(j)*180./pi.lt.-80.) then |
---|
1043 | c$$$ qsurf(ig,igcm_h2o_ice)=1.e5 |
---|
1044 | c$$$ qsurf(ig,igcm_h2o_vap)=0.0 !1.e5 |
---|
1045 | c$$$ |
---|
1046 | c$$$ write(*,*) 'ig=',ig,' H2O ice mass (kg/m2)= ', |
---|
1047 | c$$$ & qsurf(ig,igcm_h2o_ice) |
---|
1048 | c$$$ write(*,*)' ==> Ice mesh North boundary (deg)= ', |
---|
1049 | c$$$ & rlatv(j-1)*180./pi |
---|
1050 | c$$$ end if |
---|
1051 | c$$$ enddo |
---|
1052 | |
---|
1053 | |
---|
1054 | c noacglac : H2O ice across highest terrain |
---|
1055 | c -------------------------------------------- |
---|
1056 | else if (modif(1:len_trim(modif)) .eq. 'noacglac') then |
---|
1057 | if (igcm_h2o_ice.eq.0) then |
---|
1058 | write(*,*) "No water ice tracer! Can't use this option" |
---|
1059 | stop |
---|
1060 | endif |
---|
1061 | DO j=1,jjp1 |
---|
1062 | DO i=1,iim |
---|
1063 | ig=1+(j-2)*iim +i |
---|
1064 | if(j.eq.1) ig=1 |
---|
1065 | if(j.eq.jjp1) ig=ngridmx |
---|
1066 | |
---|
1067 | if(phis(i,j).gt.1000.*g)then |
---|
1068 | alb(i,j) = 0.5 ! snow value |
---|
1069 | do isoil=1,nsoilmx |
---|
1070 | ith(i,j,isoil) = 18000. ! thermal inertia |
---|
1071 | ! this leads to rnat set to 'ocean' in physiq.F90 |
---|
1072 | ! actually no, because it is soil not surface |
---|
1073 | enddo |
---|
1074 | endif |
---|
1075 | ENDDO |
---|
1076 | ENDDO |
---|
1077 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1078 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
1079 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
1080 | |
---|
1081 | |
---|
1082 | |
---|
1083 | c oborealis : H2O oceans across Vastitas Borealis |
---|
1084 | c ----------------------------------------------- |
---|
1085 | else if (modif(1:len_trim(modif)) .eq. 'oborealis') then |
---|
1086 | if (igcm_h2o_ice.eq.0) then |
---|
1087 | write(*,*) "No water ice tracer! Can't use this option" |
---|
1088 | stop |
---|
1089 | endif |
---|
1090 | DO j=1,jjp1 |
---|
1091 | DO i=1,iim |
---|
1092 | ig=1+(j-2)*iim +i |
---|
1093 | if(j.eq.1) ig=1 |
---|
1094 | if(j.eq.jjp1) ig=ngridmx |
---|
1095 | |
---|
1096 | if(phis(i,j).lt.-4000.*g)then |
---|
1097 | ! if( (phis(i,j).lt.-4000.*g) |
---|
1098 | ! & .and. (rlatu(j)*180./pi.lt.0.) )then ! south hemisphere only |
---|
1099 | ! phis(i,j)=-8000.0*g ! proper ocean |
---|
1100 | phis(i,j)=-4000.0*g ! scanty ocean |
---|
1101 | |
---|
1102 | alb(i,j) = 0.07 ! oceanic value |
---|
1103 | do isoil=1,nsoilmx |
---|
1104 | ith(i,j,isoil) = 18000. ! thermal inertia |
---|
1105 | ! this leads to rnat set to 'ocean' in physiq.F90 |
---|
1106 | ! actually no, because it is soil not surface |
---|
1107 | enddo |
---|
1108 | endif |
---|
1109 | ENDDO |
---|
1110 | ENDDO |
---|
1111 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1112 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
1113 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
1114 | |
---|
1115 | c iborealis : H2O ice in Northern plains |
---|
1116 | c -------------------------------------- |
---|
1117 | else if (modif(1:len_trim(modif)) .eq. 'iborealis') then |
---|
1118 | if (igcm_h2o_ice.eq.0) then |
---|
1119 | write(*,*) "No water ice tracer! Can't use this option" |
---|
1120 | stop |
---|
1121 | endif |
---|
1122 | DO j=1,jjp1 |
---|
1123 | DO i=1,iim |
---|
1124 | ig=1+(j-2)*iim +i |
---|
1125 | if(j.eq.1) ig=1 |
---|
1126 | if(j.eq.jjp1) ig=ngridmx |
---|
1127 | |
---|
1128 | if(phis(i,j).lt.-4000.*g)then |
---|
1129 | !qsurf(ig,igcm_h2o_ice)=1.e3 |
---|
1130 | qsurf(ig,igcm_h2o_ice)=241.4 ! to make total 33 kg m^-2 |
---|
1131 | endif |
---|
1132 | ENDDO |
---|
1133 | ENDDO |
---|
1134 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1135 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
1136 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
1137 | |
---|
1138 | |
---|
1139 | c oceanball : H2O liquid everywhere |
---|
1140 | c ---------------------------- |
---|
1141 | else if (modif(1:len_trim(modif)) .eq. 'oceanball') then |
---|
1142 | if (igcm_h2o_ice.eq.0) then |
---|
1143 | write(*,*) "No water ice tracer! Can't use this option" |
---|
1144 | stop |
---|
1145 | endif |
---|
1146 | DO j=1,jjp1 |
---|
1147 | DO i=1,iim |
---|
1148 | ig=1+(j-2)*iim +i |
---|
1149 | if(j.eq.1) ig=1 |
---|
1150 | if(j.eq.jjp1) ig=ngridmx |
---|
1151 | |
---|
1152 | qsurf(ig,igcm_h2o_vap)=0.0 ! for ocean, this is infinite source |
---|
1153 | qsurf(ig,igcm_h2o_ice)=0.0 |
---|
1154 | alb(i,j) = 0.07 ! ocean value |
---|
1155 | |
---|
1156 | do isoil=1,nsoilmx |
---|
1157 | ith(i,j,isoil) = 18000. ! thermal inertia |
---|
1158 | !ith(i,j,isoil) = 50. ! extremely low for test |
---|
1159 | ! this leads to rnat set to 'ocean' in physiq.F90 |
---|
1160 | enddo |
---|
1161 | |
---|
1162 | ENDDO |
---|
1163 | ENDDO |
---|
1164 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1165 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
1166 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) |
---|
1167 | |
---|
1168 | c iceball : H2O ice everywhere |
---|
1169 | c ---------------------------- |
---|
1170 | else if (modif(1:len_trim(modif)) .eq. 'iceball') then |
---|
1171 | if (igcm_h2o_ice.eq.0) then |
---|
1172 | write(*,*) "No water ice tracer! Can't use this option" |
---|
1173 | stop |
---|
1174 | endif |
---|
1175 | DO j=1,jjp1 |
---|
1176 | DO i=1,iim |
---|
1177 | ig=1+(j-2)*iim +i |
---|
1178 | if(j.eq.1) ig=1 |
---|
1179 | if(j.eq.jjp1) ig=ngridmx |
---|
1180 | |
---|
1181 | qsurf(ig,igcm_h2o_vap)=-50. ! for ocean, this is infinite source |
---|
1182 | qsurf(ig,igcm_h2o_ice)=50. ! == to 0.05 m of oceanic ice |
---|
1183 | alb(i,j) = 0.6 ! ice albedo value |
---|
1184 | |
---|
1185 | do isoil=1,nsoilmx |
---|
1186 | !ith(i,j,isoil) = 18000. ! thermal inertia |
---|
1187 | ! this leads to rnat set to 'ocean' in physiq.F90 |
---|
1188 | enddo |
---|
1189 | |
---|
1190 | ENDDO |
---|
1191 | ENDDO |
---|
1192 | CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1193 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,alb,albfi) |
---|
1194 | |
---|
1195 | c isotherm : Isothermal temperatures and no winds |
---|
1196 | c ----------------------------------------------- |
---|
1197 | else if (modif(1:len_trim(modif)) .eq. 'isotherm') then |
---|
1198 | |
---|
1199 | write(*,*)'Isothermal temperature of the atmosphere, |
---|
1200 | & surface and subsurface' |
---|
1201 | write(*,*) 'Value of this temperature ? :' |
---|
1202 | 203 read(*,*,iostat=ierr) Tiso |
---|
1203 | if(ierr.ne.0) goto 203 |
---|
1204 | |
---|
1205 | do ig=1, ngridmx |
---|
1206 | tsurf(ig) = Tiso |
---|
1207 | end do |
---|
1208 | do l=2,nsoilmx |
---|
1209 | do ig=1, ngridmx |
---|
1210 | tsoil(ig,l) = Tiso |
---|
1211 | end do |
---|
1212 | end do |
---|
1213 | DO j=1,jjp1 |
---|
1214 | DO i=1,iim |
---|
1215 | Do l=1,llm |
---|
1216 | Tset(i,j,l)=Tiso |
---|
1217 | end do |
---|
1218 | end do |
---|
1219 | end do |
---|
1220 | flagtset=.true. |
---|
1221 | call initial0(llm*ip1jmp1,ucov) |
---|
1222 | call initial0(llm*ip1jm,vcov) |
---|
1223 | call initial0(ngridmx*(llm+1),q2) |
---|
1224 | |
---|
1225 | c radequi : Radiative equilibrium profile of temperatures and no winds |
---|
1226 | c -------------------------------------------------------------------- |
---|
1227 | else if (modif(1:len_trim(modif)) .eq. 'radequi') then |
---|
1228 | |
---|
1229 | write(*,*)'radiative equilibrium temperature profile' |
---|
1230 | |
---|
1231 | do ig=1, ngridmx |
---|
1232 | teque= 335.0-60.0*sin(latfi(ig))*sin(latfi(ig))- |
---|
1233 | & 10.0*cos(latfi(ig))*cos(latfi(ig)) |
---|
1234 | tsurf(ig) = MAX(220.0,teque) |
---|
1235 | end do |
---|
1236 | do l=2,nsoilmx |
---|
1237 | do ig=1, ngridmx |
---|
1238 | tsoil(ig,l) = tsurf(ig) |
---|
1239 | end do |
---|
1240 | end do |
---|
1241 | DO j=1,jjp1 |
---|
1242 | DO i=1,iim |
---|
1243 | Do l=1,llm |
---|
1244 | teque=335.-60.0*sin(rlatu(j))*sin(rlatu(j))- |
---|
1245 | & 10.0*cos(rlatu(j))*cos(rlatu(j)) |
---|
1246 | Tset(i,j,l)=MAX(220.0,teque) |
---|
1247 | end do |
---|
1248 | end do |
---|
1249 | end do |
---|
1250 | flagtset=.true. |
---|
1251 | call initial0(llm*ip1jmp1,ucov) |
---|
1252 | call initial0(llm*ip1jm,vcov) |
---|
1253 | call initial0(ngridmx*(llm+1),q2) |
---|
1254 | |
---|
1255 | c coldstart : T set 1K above CO2 frost point and no winds |
---|
1256 | c ------------------------------------------------ |
---|
1257 | else if (modif(1:len_trim(modif)) .eq. 'coldstart') then |
---|
1258 | |
---|
1259 | write(*,*)'set temperature of the atmosphere,' |
---|
1260 | &,'surface and subsurface how many degrees above CO2 frost point?' |
---|
1261 | 204 read(*,*,iostat=ierr) Tabove |
---|
1262 | if(ierr.ne.0) goto 204 |
---|
1263 | |
---|
1264 | DO j=1,jjp1 |
---|
1265 | DO i=1,iim |
---|
1266 | ig=1+(j-2)*iim +i |
---|
1267 | if(j.eq.1) ig=1 |
---|
1268 | if(j.eq.jjp1) ig=ngridmx |
---|
1269 | tsurf(ig) = (-3167.8)/(log(.01*ps(i,j))-23.23)+Tabove |
---|
1270 | END DO |
---|
1271 | END DO |
---|
1272 | do l=1,nsoilmx |
---|
1273 | do ig=1, ngridmx |
---|
1274 | tsoil(ig,l) = tsurf(ig) |
---|
1275 | end do |
---|
1276 | end do |
---|
1277 | DO j=1,jjp1 |
---|
1278 | DO i=1,iim |
---|
1279 | Do l=1,llm |
---|
1280 | pp = aps(l) +bps(l)*ps(i,j) |
---|
1281 | Tset(i,j,l)=(-3167.8)/(log(.01*pp)-23.23)+Tabove |
---|
1282 | end do |
---|
1283 | end do |
---|
1284 | end do |
---|
1285 | |
---|
1286 | flagtset=.true. |
---|
1287 | call initial0(llm*ip1jmp1,ucov) |
---|
1288 | call initial0(llm*ip1jm,vcov) |
---|
1289 | call initial0(ngridmx*(llm+1),q2) |
---|
1290 | |
---|
1291 | |
---|
1292 | c co2ice=0 : remove CO2 polar ice caps' |
---|
1293 | c ------------------------------------------------ |
---|
1294 | else if (modif(1:len_trim(modif)) .eq. 'co2ice=0') then |
---|
1295 | ! check that there is indeed a co2_ice tracer ... |
---|
1296 | if (igcm_co2_ice.ne.0) then |
---|
1297 | do ig=1,ngridmx |
---|
1298 | !co2ice(ig)=0 |
---|
1299 | qsurf(ig,igcm_co2_ice)=0 |
---|
1300 | emis(ig)=emis(ngridmx/2) |
---|
1301 | end do |
---|
1302 | else |
---|
1303 | write(*,*) "Can't remove CO2 ice!! (no co2_ice tracer)" |
---|
1304 | endif |
---|
1305 | |
---|
1306 | ! therm_ini_s: (re)-set soil thermal inertia to reference surface values |
---|
1307 | ! ---------------------------------------------------------------------- |
---|
1308 | |
---|
1309 | else if (modif(1:len_trim(modif)).eq.'therm_ini_s') then |
---|
1310 | ! write(*,*)"surfithfi(1):",surfithfi(1) |
---|
1311 | do isoil=1,nsoilmx |
---|
1312 | inertiedat(1:ngridmx,isoil)=surfithfi(1:ngridmx) |
---|
1313 | enddo |
---|
1314 | write(*,*)'OK: Soil thermal inertia has been reset to referenc |
---|
1315 | &e surface values' |
---|
1316 | ! write(*,*)"inertiedat(1,1):",inertiedat(1,1) |
---|
1317 | ithfi(:,:)=inertiedat(:,:) |
---|
1318 | ! recast ithfi() onto ith() |
---|
1319 | call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith) |
---|
1320 | ! Check: |
---|
1321 | ! do i=1,iip1 |
---|
1322 | ! do j=1,jjp1 |
---|
1323 | ! do isoil=1,nsoilmx |
---|
1324 | ! write(77,*) i,j,isoil," ",ith(i,j,isoil) |
---|
1325 | ! enddo |
---|
1326 | ! enddo |
---|
1327 | ! enddo |
---|
1328 | |
---|
1329 | |
---|
1330 | |
---|
1331 | |
---|
1332 | c$$$! subsoilice_n: Put deep ice layer in northern hemisphere soil |
---|
1333 | c$$$! ------------------------------------------------------------ |
---|
1334 | c$$$ |
---|
1335 | c$$$ else if (modif(1:len_trim(modif)).eq.'subsoilice_n') then |
---|
1336 | c$$$ |
---|
1337 | c$$$ write(*,*)'From which latitude (in deg.), up to the north pole, |
---|
1338 | c$$$ &should we put subterranean ice?' |
---|
1339 | c$$$ ierr=1 |
---|
1340 | c$$$ do while (ierr.ne.0) |
---|
1341 | c$$$ read(*,*,iostat=ierr) val |
---|
1342 | c$$$ if (ierr.eq.0) then ! got a value |
---|
1343 | c$$$ ! do a sanity check |
---|
1344 | c$$$ if((val.lt.0.).or.(val.gt.90)) then |
---|
1345 | c$$$ write(*,*)'Latitude should be between 0 and 90 deg. !!!' |
---|
1346 | c$$$ ierr=1 |
---|
1347 | c$$$ else ! find corresponding jref (nearest latitude) |
---|
1348 | c$$$ ! note: rlatu(:) contains decreasing values of latitude |
---|
1349 | c$$$ ! starting from PI/2 to -PI/2 |
---|
1350 | c$$$ do j=1,jjp1 |
---|
1351 | c$$$ if ((rlatu(j)*180./pi.ge.val).and. |
---|
1352 | c$$$ & (rlatu(j+1)*180./pi.le.val)) then |
---|
1353 | c$$$ ! find which grid point is nearest to val: |
---|
1354 | c$$$ if (abs(rlatu(j)*180./pi-val).le. |
---|
1355 | c$$$ & abs((rlatu(j+1)*180./pi-val))) then |
---|
1356 | c$$$ jref=j |
---|
1357 | c$$$ else |
---|
1358 | c$$$ jref=j+1 |
---|
1359 | c$$$ endif |
---|
1360 | c$$$ |
---|
1361 | c$$$ write(*,*)'Will use nearest grid latitude which is:', |
---|
1362 | c$$$ & rlatu(jref)*180./pi |
---|
1363 | c$$$ endif |
---|
1364 | c$$$ enddo ! of do j=1,jjp1 |
---|
1365 | c$$$ endif ! of if((val.lt.0.).or.(val.gt.90)) |
---|
1366 | c$$$ endif !of if (ierr.eq.0) |
---|
1367 | c$$$ enddo ! of do while |
---|
1368 | c$$$ |
---|
1369 | c$$$ ! Build layers() (as in soil_settings.F) |
---|
1370 | c$$$ val2=sqrt(mlayer(0)*mlayer(1)) |
---|
1371 | c$$$ val3=mlayer(1)/mlayer(0) |
---|
1372 | c$$$ do isoil=1,nsoilmx |
---|
1373 | c$$$ layer(isoil)=val2*(val3**(isoil-1)) |
---|
1374 | c$$$ enddo |
---|
1375 | c$$$ |
---|
1376 | c$$$ write(*,*)'At which depth (in m.) does the ice layer begin?' |
---|
1377 | c$$$ write(*,*)'(currently, the deepest soil layer extends down to:' |
---|
1378 | c$$$ & ,layer(nsoilmx),')' |
---|
1379 | c$$$ ierr=1 |
---|
1380 | c$$$ do while (ierr.ne.0) |
---|
1381 | c$$$ read(*,*,iostat=ierr) val2 |
---|
1382 | c$$$! write(*,*)'val2:',val2,'ierr=',ierr |
---|
1383 | c$$$ if (ierr.eq.0) then ! got a value, but do a sanity check |
---|
1384 | c$$$ if(val2.gt.layer(nsoilmx)) then |
---|
1385 | c$$$ write(*,*)'Depth should be less than ',layer(nsoilmx) |
---|
1386 | c$$$ ierr=1 |
---|
1387 | c$$$ endif |
---|
1388 | c$$$ if(val2.lt.layer(1)) then |
---|
1389 | c$$$ write(*,*)'Depth should be more than ',layer(1) |
---|
1390 | c$$$ ierr=1 |
---|
1391 | c$$$ endif |
---|
1392 | c$$$ endif |
---|
1393 | c$$$ enddo ! of do while |
---|
1394 | c$$$ |
---|
1395 | c$$$ ! find the reference index iref the depth corresponds to |
---|
1396 | c$$$! if (val2.lt.layer(1)) then |
---|
1397 | c$$$! iref=1 |
---|
1398 | c$$$! else |
---|
1399 | c$$$ do isoil=1,nsoilmx-1 |
---|
1400 | c$$$ if((val2.gt.layer(isoil)).and.(val2.lt.layer(isoil+1))) |
---|
1401 | c$$$ & then |
---|
1402 | c$$$ iref=isoil |
---|
1403 | c$$$ exit |
---|
1404 | c$$$ endif |
---|
1405 | c$$$ enddo |
---|
1406 | c$$$! endif |
---|
1407 | c$$$ |
---|
1408 | c$$$! write(*,*)'iref:',iref,' jref:',jref |
---|
1409 | c$$$! write(*,*)'layer',layer |
---|
1410 | c$$$! write(*,*)'mlayer',mlayer |
---|
1411 | c$$$ |
---|
1412 | c$$$ ! thermal inertia of the ice: |
---|
1413 | c$$$ ierr=1 |
---|
1414 | c$$$ do while (ierr.ne.0) |
---|
1415 | c$$$ write(*,*)'What is the value of subterranean ice thermal inert |
---|
1416 | c$$$ &ia? (e.g.: 2000)' |
---|
1417 | c$$$ read(*,*,iostat=ierr)iceith |
---|
1418 | c$$$ enddo ! of do while |
---|
1419 | c$$$ |
---|
1420 | c$$$ ! recast ithfi() onto ith() |
---|
1421 | c$$$ call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith) |
---|
1422 | c$$$ |
---|
1423 | c$$$ do j=1,jref |
---|
1424 | c$$$! write(*,*)'j:',j,'rlatu(j)*180./pi:',rlatu(j)*180./pi |
---|
1425 | c$$$ do i=1,iip1 ! loop on longitudes |
---|
1426 | c$$$ ! Build "equivalent" thermal inertia for the mixed layer |
---|
1427 | c$$$ ith(i,j,iref+1)=sqrt((layer(iref+1)-layer(iref))/ |
---|
1428 | c$$$ & (((val2-layer(iref))/(ith(i,j,iref)**2))+ |
---|
1429 | c$$$ & ((layer(iref+1)-val2)/(iceith)**2))) |
---|
1430 | c$$$ ! Set thermal inertia of lower layers |
---|
1431 | c$$$ do isoil=iref+2,nsoilmx |
---|
1432 | c$$$ ith(i,j,isoil)=iceith ! ice |
---|
1433 | c$$$ enddo |
---|
1434 | c$$$ enddo ! of do i=1,iip1 |
---|
1435 | c$$$ enddo ! of do j=1,jjp1 |
---|
1436 | c$$$ |
---|
1437 | c$$$ |
---|
1438 | c$$$ CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1439 | c$$$ |
---|
1440 | c$$$! do i=1,nsoilmx |
---|
1441 | c$$$! write(*,*)'i:',i,'ithfi(1,i):',ithfi(1,i) |
---|
1442 | c$$$! enddo |
---|
1443 | |
---|
1444 | |
---|
1445 | c$$$! subsoilice_s: Put deep ice layer in southern hemisphere soil |
---|
1446 | c$$$! ------------------------------------------------------------ |
---|
1447 | c$$$ |
---|
1448 | c$$$ else if (modif(1:len_trim(modif)).eq.'subsoilice_s') then |
---|
1449 | c$$$ |
---|
1450 | c$$$ write(*,*)'From which latitude (in deg.), down to the south pol |
---|
1451 | c$$$ &e, should we put subterranean ice?' |
---|
1452 | c$$$ ierr=1 |
---|
1453 | c$$$ do while (ierr.ne.0) |
---|
1454 | c$$$ read(*,*,iostat=ierr) val |
---|
1455 | c$$$ if (ierr.eq.0) then ! got a value |
---|
1456 | c$$$ ! do a sanity check |
---|
1457 | c$$$ if((val.gt.0.).or.(val.lt.-90)) then |
---|
1458 | c$$$ write(*,*)'Latitude should be between 0 and -90 deg. !!!' |
---|
1459 | c$$$ ierr=1 |
---|
1460 | c$$$ else ! find corresponding jref (nearest latitude) |
---|
1461 | c$$$ ! note: rlatu(:) contains decreasing values of latitude |
---|
1462 | c$$$ ! starting from PI/2 to -PI/2 |
---|
1463 | c$$$ do j=1,jjp1 |
---|
1464 | c$$$ if ((rlatu(j)*180./pi.ge.val).and. |
---|
1465 | c$$$ & (rlatu(j+1)*180./pi.le.val)) then |
---|
1466 | c$$$ ! find which grid point is nearest to val: |
---|
1467 | c$$$ if (abs(rlatu(j)*180./pi-val).le. |
---|
1468 | c$$$ & abs((rlatu(j+1)*180./pi-val))) then |
---|
1469 | c$$$ jref=j |
---|
1470 | c$$$ else |
---|
1471 | c$$$ jref=j+1 |
---|
1472 | c$$$ endif |
---|
1473 | c$$$ |
---|
1474 | c$$$ write(*,*)'Will use nearest grid latitude which is:', |
---|
1475 | c$$$ & rlatu(jref)*180./pi |
---|
1476 | c$$$ endif |
---|
1477 | c$$$ enddo ! of do j=1,jjp1 |
---|
1478 | c$$$ endif ! of if((val.lt.0.).or.(val.gt.90)) |
---|
1479 | c$$$ endif !of if (ierr.eq.0) |
---|
1480 | c$$$ enddo ! of do while |
---|
1481 | c$$$ |
---|
1482 | c$$$ ! Build layers() (as in soil_settings.F) |
---|
1483 | c$$$ val2=sqrt(mlayer(0)*mlayer(1)) |
---|
1484 | c$$$ val3=mlayer(1)/mlayer(0) |
---|
1485 | c$$$ do isoil=1,nsoilmx |
---|
1486 | c$$$ layer(isoil)=val2*(val3**(isoil-1)) |
---|
1487 | c$$$ enddo |
---|
1488 | c$$$ |
---|
1489 | c$$$ write(*,*)'At which depth (in m.) does the ice layer begin?' |
---|
1490 | c$$$ write(*,*)'(currently, the deepest soil layer extends down to:' |
---|
1491 | c$$$ & ,layer(nsoilmx),')' |
---|
1492 | c$$$ ierr=1 |
---|
1493 | c$$$ do while (ierr.ne.0) |
---|
1494 | c$$$ read(*,*,iostat=ierr) val2 |
---|
1495 | c$$$! write(*,*)'val2:',val2,'ierr=',ierr |
---|
1496 | c$$$ if (ierr.eq.0) then ! got a value, but do a sanity check |
---|
1497 | c$$$ if(val2.gt.layer(nsoilmx)) then |
---|
1498 | c$$$ write(*,*)'Depth should be less than ',layer(nsoilmx) |
---|
1499 | c$$$ ierr=1 |
---|
1500 | c$$$ endif |
---|
1501 | c$$$ if(val2.lt.layer(1)) then |
---|
1502 | c$$$ write(*,*)'Depth should be more than ',layer(1) |
---|
1503 | c$$$ ierr=1 |
---|
1504 | c$$$ endif |
---|
1505 | c$$$ endif |
---|
1506 | c$$$ enddo ! of do while |
---|
1507 | c$$$ |
---|
1508 | c$$$ ! find the reference index iref the depth corresponds to |
---|
1509 | c$$$ do isoil=1,nsoilmx-1 |
---|
1510 | c$$$ if((val2.gt.layer(isoil)).and.(val2.lt.layer(isoil+1))) |
---|
1511 | c$$$ & then |
---|
1512 | c$$$ iref=isoil |
---|
1513 | c$$$ exit |
---|
1514 | c$$$ endif |
---|
1515 | c$$$ enddo |
---|
1516 | c$$$ |
---|
1517 | c$$$! write(*,*)'iref:',iref,' jref:',jref |
---|
1518 | c$$$ |
---|
1519 | c$$$ ! thermal inertia of the ice: |
---|
1520 | c$$$ ierr=1 |
---|
1521 | c$$$ do while (ierr.ne.0) |
---|
1522 | c$$$ write(*,*)'What is the value of subterranean ice thermal inert |
---|
1523 | c$$$ &ia? (e.g.: 2000)' |
---|
1524 | c$$$ read(*,*,iostat=ierr)iceith |
---|
1525 | c$$$ enddo ! of do while |
---|
1526 | c$$$ |
---|
1527 | c$$$ ! recast ithfi() onto ith() |
---|
1528 | c$$$ call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith) |
---|
1529 | c$$$ |
---|
1530 | c$$$ do j=jref,jjp1 |
---|
1531 | c$$$! write(*,*)'j:',j,'rlatu(j)*180./pi:',rlatu(j)*180./pi |
---|
1532 | c$$$ do i=1,iip1 ! loop on longitudes |
---|
1533 | c$$$ ! Build "equivalent" thermal inertia for the mixed layer |
---|
1534 | c$$$ ith(i,j,iref+1)=sqrt((layer(iref+1)-layer(iref))/ |
---|
1535 | c$$$ & (((val2-layer(iref))/(ith(i,j,iref)**2))+ |
---|
1536 | c$$$ & ((layer(iref+1)-val2)/(iceith)**2))) |
---|
1537 | c$$$ ! Set thermal inertia of lower layers |
---|
1538 | c$$$ do isoil=iref+2,nsoilmx |
---|
1539 | c$$$ ith(i,j,isoil)=iceith ! ice |
---|
1540 | c$$$ enddo |
---|
1541 | c$$$ enddo ! of do i=1,iip1 |
---|
1542 | c$$$ enddo ! of do j=jref,jjp1 |
---|
1543 | c$$$ |
---|
1544 | c$$$ |
---|
1545 | c$$$ CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1546 | |
---|
1547 | |
---|
1548 | c$$$c 'mons_ice' : use MONS data to build subsurface ice table |
---|
1549 | c$$$c -------------------------------------------------------- |
---|
1550 | c$$$ else if (modif(1:len_trim(modif)).eq.'mons_ice') then |
---|
1551 | c$$$ |
---|
1552 | c$$$ ! 1. Load MONS data |
---|
1553 | c$$$ call load_MONS_data(MONS_Hdn,MONS_d21) |
---|
1554 | c$$$ |
---|
1555 | c$$$ ! 2. Get parameters from user |
---|
1556 | c$$$ ierr=1 |
---|
1557 | c$$$ do while (ierr.ne.0) |
---|
1558 | c$$$ write(*,*) "Coefficient to apply to MONS 'depth' in Northern", |
---|
1559 | c$$$ & " Hemisphere?" |
---|
1560 | c$$$ write(*,*) " (should be somewhere between 3.2e-4 and 1.3e-3)" |
---|
1561 | c$$$ read(*,*,iostat=ierr) MONS_coeffN |
---|
1562 | c$$$ enddo |
---|
1563 | c$$$ ierr=1 |
---|
1564 | c$$$ do while (ierr.ne.0) |
---|
1565 | c$$$ write(*,*) "Coefficient to apply to MONS 'depth' in Southern", |
---|
1566 | c$$$ & " Hemisphere?" |
---|
1567 | c$$$ write(*,*) " (should be somewhere between 3.2e-4 and 1.3e-3)" |
---|
1568 | c$$$ read(*,*,iostat=ierr) MONS_coeffS |
---|
1569 | c$$$ enddo |
---|
1570 | c$$$ ierr=1 |
---|
1571 | c$$$ do while (ierr.ne.0) |
---|
1572 | c$$$ write(*,*) "Value of subterranean ice thermal inertia?" |
---|
1573 | c$$$ write(*,*) " (e.g.: 2000, or perhaps 2290)" |
---|
1574 | c$$$ read(*,*,iostat=ierr) iceith |
---|
1575 | c$$$ enddo |
---|
1576 | c$$$ |
---|
1577 | c$$$ ! 3. Build subterranean thermal inertia |
---|
1578 | c$$$ |
---|
1579 | c$$$ ! initialise subsurface inertia with reference surface values |
---|
1580 | c$$$ do isoil=1,nsoilmx |
---|
1581 | c$$$ ithfi(1:ngridmx,isoil)=surfithfi(1:ngridmx) |
---|
1582 | c$$$ enddo |
---|
1583 | c$$$ ! recast ithfi() onto ith() |
---|
1584 | c$$$ call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith) |
---|
1585 | c$$$ |
---|
1586 | c$$$ do i=1,iip1 ! loop on longitudes |
---|
1587 | c$$$ do j=1,jjp1 ! loop on latitudes |
---|
1588 | c$$$ ! set MONS_coeff |
---|
1589 | c$$$ if (rlatu(j).ge.0) then ! northern hemisphere |
---|
1590 | c$$$ ! N.B: rlatu(:) contains decreasing values of latitude |
---|
1591 | c$$$ ! starting from PI/2 to -PI/2 |
---|
1592 | c$$$ MONS_coeff=MONS_coeffN |
---|
1593 | c$$$ else ! southern hemisphere |
---|
1594 | c$$$ MONS_coeff=MONS_coeffS |
---|
1595 | c$$$ endif |
---|
1596 | c$$$ ! check if we should put subterranean ice |
---|
1597 | c$$$ if (MONS_Hdn(i,j).ge.14.0) then ! no ice if Hdn<14% |
---|
1598 | c$$$ ! compute depth at which ice lies: |
---|
1599 | c$$$ val=MONS_d21(i,j)*MONS_coeff |
---|
1600 | c$$$ ! compute val2= the diurnal skin depth of surface inertia |
---|
1601 | c$$$ ! assuming a volumetric heat cap. of C=1.e6 J.m-3.K-1 |
---|
1602 | c$$$ val2=ith(i,j,1)*1.e-6*sqrt(88775./3.14159) |
---|
1603 | c$$$ if (val.lt.val2) then |
---|
1604 | c$$$ ! ice must be below the (surface inertia) diurnal skin depth |
---|
1605 | c$$$ val=val2 |
---|
1606 | c$$$ endif |
---|
1607 | c$$$ if (val.lt.layer(nsoilmx)) then ! subterranean ice |
---|
1608 | c$$$ ! find the reference index iref that depth corresponds to |
---|
1609 | c$$$ iref=0 |
---|
1610 | c$$$ do isoil=1,nsoilmx-1 |
---|
1611 | c$$$ if ((val.ge.layer(isoil)).and.(val.lt.layer(isoil+1))) |
---|
1612 | c$$$ & then |
---|
1613 | c$$$ iref=isoil |
---|
1614 | c$$$ exit |
---|
1615 | c$$$ endif |
---|
1616 | c$$$ enddo |
---|
1617 | c$$$ ! Build "equivalent" thermal inertia for the mixed layer |
---|
1618 | c$$$ ith(i,j,iref+1)=sqrt((layer(iref+1)-layer(iref))/ |
---|
1619 | c$$$ & (((val-layer(iref))/(ith(i,j,iref+1)**2))+ |
---|
1620 | c$$$ & ((layer(iref+1)-val)/(iceith)**2))) |
---|
1621 | c$$$ ! Set thermal inertia of lower layers |
---|
1622 | c$$$ do isoil=iref+2,nsoilmx |
---|
1623 | c$$$ ith(i,j,isoil)=iceith |
---|
1624 | c$$$ enddo |
---|
1625 | c$$$ endif ! of if (val.lt.layer(nsoilmx)) |
---|
1626 | c$$$ endif ! of if (MONS_Hdn(i,j).lt.14.0) |
---|
1627 | c$$$ enddo ! do j=1,jjp1 |
---|
1628 | c$$$ enddo ! do i=1,iip1 |
---|
1629 | c$$$ |
---|
1630 | c$$$! Check: |
---|
1631 | c$$$! do i=1,iip1 |
---|
1632 | c$$$! do j=1,jjp1 |
---|
1633 | c$$$! do isoil=1,nsoilmx |
---|
1634 | c$$$! write(77,*) i,j,isoil," ",ith(i,j,isoil) |
---|
1635 | c$$$! enddo |
---|
1636 | c$$$! enddo |
---|
1637 | c$$$! enddo |
---|
1638 | c$$$ |
---|
1639 | c$$$ ! recast ith() into ithfi() |
---|
1640 | c$$$ CALL gr_dyn_fi(nsoilmx,iip1,jjp1,ngridmx,ith,ithfi) |
---|
1641 | c$$$ |
---|
1642 | c$$$ else |
---|
1643 | c$$$ write(*,*) ' Unknown (misspelled?) option!!!' |
---|
1644 | end if ! of if (modif(1:len_trim(modif)) .eq. '...') elseif ... |
---|
1645 | |
---|
1646 | |
---|
1647 | |
---|
1648 | |
---|
1649 | |
---|
1650 | |
---|
1651 | |
---|
1652 | |
---|
1653 | |
---|
1654 | |
---|
1655 | |
---|
1656 | enddo ! of do ! infinite loop on liste of changes |
---|
1657 | |
---|
1658 | 999 continue |
---|
1659 | |
---|
1660 | |
---|
1661 | c======================================================================= |
---|
1662 | c Initialisation for cloud fraction and oceanic ice (added by BC 2010) |
---|
1663 | c======================================================================= |
---|
1664 | DO ig=1, ngridmx |
---|
1665 | totalfrac(ig)=0.5 |
---|
1666 | DO l=1,llm |
---|
1667 | cloudfrac(ig,l)=0.5 |
---|
1668 | ENDDO |
---|
1669 | ! Ehouarn, march 2012: also add some initialisation for hice |
---|
1670 | hice(ig)=0.0 |
---|
1671 | ENDDO |
---|
1672 | |
---|
1673 | c======================================================== |
---|
1674 | |
---|
1675 | ! DO ig=1,ngridmx |
---|
1676 | ! IF(tsurf(ig) .LT. 273.16-1.8) THEN |
---|
1677 | ! hice(ig)=(273.16-1.8-tsurf(ig))/(273.16-1.8-240)*1. |
---|
1678 | ! hice(ig)=min(hice(ig),1.0) |
---|
1679 | ! ENDIF |
---|
1680 | ! ENDDO |
---|
1681 | |
---|
1682 | c======================================================================= |
---|
1683 | c Correct pressure on the new grid (menu 0) |
---|
1684 | c======================================================================= |
---|
1685 | |
---|
1686 | |
---|
1687 | if ((choix_1.eq.0).and.(.not.flagps0)) then |
---|
1688 | r = 1000.*8.31/mugaz |
---|
1689 | |
---|
1690 | do j=1,jjp1 |
---|
1691 | do i=1,iip1 |
---|
1692 | ps(i,j) = ps(i,j) * |
---|
1693 | . exp((phisold_newgrid(i,j)-phis(i,j)) / |
---|
1694 | . (t(i,j,1) * r)) |
---|
1695 | end do |
---|
1696 | end do |
---|
1697 | |
---|
1698 | c periodicite de ps en longitude |
---|
1699 | do j=1,jjp1 |
---|
1700 | ps(1,j) = ps(iip1,j) |
---|
1701 | end do |
---|
1702 | end if |
---|
1703 | |
---|
1704 | |
---|
1705 | c======================================================================= |
---|
1706 | c======================================================================= |
---|
1707 | |
---|
1708 | c======================================================================= |
---|
1709 | c Initialisation de la physique / ecriture de newstartfi : |
---|
1710 | c======================================================================= |
---|
1711 | |
---|
1712 | |
---|
1713 | CALL inifilr |
---|
1714 | CALL pression(ip1jmp1, ap, bp, ps, p3d) |
---|
1715 | |
---|
1716 | c----------------------------------------------------------------------- |
---|
1717 | c Initialisation pks: |
---|
1718 | c----------------------------------------------------------------------- |
---|
1719 | |
---|
1720 | CALL exner_hyb(ip1jmp1, ps, p3d, beta, pks, pk, pkf) |
---|
1721 | ! Calcul de la temperature potentielle teta |
---|
1722 | |
---|
1723 | if (flagtset) then |
---|
1724 | DO l=1,llm |
---|
1725 | DO j=1,jjp1 |
---|
1726 | DO i=1,iim |
---|
1727 | teta(i,j,l) = Tset(i,j,l) * cpp/pk(i,j,l) |
---|
1728 | ENDDO |
---|
1729 | teta (iip1,j,l)= teta (1,j,l) |
---|
1730 | ENDDO |
---|
1731 | ENDDO |
---|
1732 | else if (choix_1.eq.0) then |
---|
1733 | DO l=1,llm |
---|
1734 | DO j=1,jjp1 |
---|
1735 | DO i=1,iim |
---|
1736 | teta(i,j,l) = t(i,j,l) * cpp/pk(i,j,l) |
---|
1737 | ENDDO |
---|
1738 | teta (iip1,j,l)= teta (1,j,l) |
---|
1739 | ENDDO |
---|
1740 | ENDDO |
---|
1741 | endif |
---|
1742 | |
---|
1743 | C Calcul intermediaire |
---|
1744 | c |
---|
1745 | if (choix_1.eq.0) then |
---|
1746 | CALL massdair( p3d, masse ) |
---|
1747 | c |
---|
1748 | print *,' ALPHAX ',alphax |
---|
1749 | |
---|
1750 | DO l = 1, llm |
---|
1751 | DO i = 1, iim |
---|
1752 | xppn(i) = aire( i, 1 ) * masse( i , 1 , l ) |
---|
1753 | xpps(i) = aire( i,jjp1 ) * masse( i , jjp1 , l ) |
---|
1754 | ENDDO |
---|
1755 | xpn = SUM(xppn)/apoln |
---|
1756 | xps = SUM(xpps)/apols |
---|
1757 | DO i = 1, iip1 |
---|
1758 | masse( i , 1 , l ) = xpn |
---|
1759 | masse( i , jjp1 , l ) = xps |
---|
1760 | ENDDO |
---|
1761 | ENDDO |
---|
1762 | endif |
---|
1763 | phis(iip1,:) = phis(1,:) |
---|
1764 | |
---|
1765 | CALL inidissip ( lstardis, nitergdiv, nitergrot, niterh, |
---|
1766 | * tetagdiv, tetagrot , tetatemp ) |
---|
1767 | itau=0 |
---|
1768 | if (choix_1.eq.0) then |
---|
1769 | day_ini=int(date) |
---|
1770 | endif |
---|
1771 | c |
---|
1772 | CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
1773 | |
---|
1774 | CALL caldyn0( itau,ucov,vcov,teta,ps,masse,pk,phis , |
---|
1775 | * phi,w, pbaru,pbarv,day_ini+time ) |
---|
1776 | |
---|
1777 | |
---|
1778 | CALL dynredem0("restart.nc",day_ini,anneeref,phis,nqmx) |
---|
1779 | CALL dynredem1("restart.nc",0.0,vcov,ucov,teta,q,nqmx,masse,ps) |
---|
1780 | C |
---|
1781 | C Ecriture etat initial physique |
---|
1782 | C |
---|
1783 | |
---|
1784 | ! do ig=1,ngridmx |
---|
1785 | ! print*,'surface ice in newstart=',qsurf(ig,igcm_h2o_ice) |
---|
1786 | ! print*,'surface liq in newstart=',qsurf(ig,igcm_h2o_vap) |
---|
1787 | ! enddo |
---|
1788 | ! stop |
---|
1789 | |
---|
1790 | |
---|
1791 | call physdem1("restartfi.nc",lonfi,latfi,nsoilmx,nqmx, |
---|
1792 | . dtphys,float(day_ini), |
---|
1793 | . time,tsurf,tsoil,emis,q2,qsurf, |
---|
1794 | . airefi,albfi,ithfi,zmea,zstd,zsig,zgam,zthe, |
---|
1795 | . cloudfrac,totalfrac,hice) |
---|
1796 | |
---|
1797 | c======================================================================= |
---|
1798 | c Formats |
---|
1799 | c======================================================================= |
---|
1800 | |
---|
1801 | 1 FORMAT(//10x,'la valeur de im =',i4,2x,'lue sur le fichier de dema |
---|
1802 | *rrage est differente de la valeur parametree iim =',i4//) |
---|
1803 | 2 FORMAT(//10x,'la valeur de jm =',i4,2x,'lue sur le fichier de dema |
---|
1804 | *rrage est differente de la valeur parametree jjm =',i4//) |
---|
1805 | 3 FORMAT(//10x,'la valeur de lllm =',i4,2x,'lue sur le fichier demar |
---|
1806 | *rage est differente de la valeur parametree llm =',i4//) |
---|
1807 | |
---|
1808 | end |
---|
1809 | |
---|
1810 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
1811 | subroutine load_MONS_data(MONS_Hdn,MONS_d21) |
---|
1812 | use datafile_mod, only: datadir |
---|
1813 | implicit none |
---|
1814 | ! routine to load Benedicte Diez MONS dataset, fill in date in southern |
---|
1815 | ! polar region, and interpolate the result onto the GCM grid |
---|
1816 | #include"dimensions.h" |
---|
1817 | #include"paramet.h" |
---|
1818 | #include"comgeom.h" |
---|
1819 | ! arguments: |
---|
1820 | real,intent(out) :: MONS_Hdn(iip1,jjp1) ! Hdn: %WEH=Mass fraction of H2O |
---|
1821 | real,intent(out) :: MONS_d21(iip1,jjp1) ! ice table "depth" (in kg/m2) |
---|
1822 | ! N.B MONS datasets should be of dimension (iip1,jjp1) |
---|
1823 | ! local variables: |
---|
1824 | character(len=88) :: filename="results_MONS_lat_lon_H_depth.txt" |
---|
1825 | character(len=88) :: txt ! to store some text |
---|
1826 | integer :: ierr,i,j |
---|
1827 | integer,parameter :: nblon=180 ! number of longitudes of MONS datasets |
---|
1828 | integer,parameter :: nblat=90 ! number of latitudes of MONS datasets |
---|
1829 | real :: pi |
---|
1830 | real :: longitudes(nblon) ! MONS dataset longitudes |
---|
1831 | real :: latitudes(nblat) ! MONS dataset latitudes |
---|
1832 | ! MONS dataset: mass fraction of H2O where H is assumed to be in H2O |
---|
1833 | real :: Hdn(nblon,nblat) |
---|
1834 | real :: d21(nblon,nblat)! MONS dataset "depth" (g/cm2) |
---|
1835 | |
---|
1836 | ! Extended MONS dataset (for interp_horiz) |
---|
1837 | real :: Hdnx(nblon+1,nblat) |
---|
1838 | real :: d21x(nblon+1,nblat) |
---|
1839 | real :: lon_bound(nblon+1) ! longitude boundaries |
---|
1840 | real :: lat_bound(nblat-1) ! latitude boundaries |
---|
1841 | |
---|
1842 | ! 1. Initializations: |
---|
1843 | |
---|
1844 | write(*,*) "Loading MONS data" |
---|
1845 | |
---|
1846 | ! Open MONS datafile: |
---|
1847 | open(42,file=trim(datadir)//"/"//trim(filename), |
---|
1848 | & status="old",iostat=ierr) |
---|
1849 | if (ierr/=0) then |
---|
1850 | write(*,*) "Error in load_MONS_data:" |
---|
1851 | write(*,*) "Failed opening file ", |
---|
1852 | & trim(datadir)//"/"//trim(filename) |
---|
1853 | write(*,*)'Check that your path to datagcm:',trim(datadir) |
---|
1854 | write(*,*)' is correct. You can change it in callphys.def with:' |
---|
1855 | write(*,*)' datadir = /absolute/path/to/datagcm' |
---|
1856 | write(*,*)'If necessary ',trim(filename), |
---|
1857 | & ' (and other datafiles)' |
---|
1858 | write(*,*)' can be obtained online at:' |
---|
1859 | write(*,*)' http://www.lmd.jussieu.fr/~forget/datagcm/datafile' |
---|
1860 | CALL ABORT |
---|
1861 | else ! skip first line of file (dummy read) |
---|
1862 | read(42,*) txt |
---|
1863 | endif |
---|
1864 | |
---|
1865 | pi=2.*asin(1.) |
---|
1866 | |
---|
1867 | !2. Load MONS data (on MONS grid) |
---|
1868 | do j=1,nblat |
---|
1869 | do i=1,nblon |
---|
1870 | ! swap latitude index so latitudes go from north pole to south pole: |
---|
1871 | read(42,*) latitudes(nblat-j+1),longitudes(i), |
---|
1872 | & Hdn(i,nblat-j+1),d21(i,nblat-j+1) |
---|
1873 | ! multiply d21 by 10 to convert from g/cm2 to kg/m2 |
---|
1874 | d21(i,nblat-j+1)=d21(i,nblat-j+1)*10.0 |
---|
1875 | enddo |
---|
1876 | enddo |
---|
1877 | close(42) |
---|
1878 | |
---|
1879 | ! there is unfortunately no d21 data for latitudes -77 to -90 |
---|
1880 | ! so we build some by linear interpolation between values at -75 |
---|
1881 | ! and assuming d21=0 at the pole |
---|
1882 | do j=84,90 ! latitudes(84)=-77 ; latitudes(83)=-75 |
---|
1883 | do i=1,nblon |
---|
1884 | d21(i,j)=d21(i,83)*((latitudes(j)+90)/15.0) |
---|
1885 | enddo |
---|
1886 | enddo |
---|
1887 | |
---|
1888 | ! 3. Build extended MONS dataset & boundaries (for interp_horiz) |
---|
1889 | ! longitude boundaries (in radians): |
---|
1890 | do i=1,nblon |
---|
1891 | ! NB: MONS data is every 2 degrees in longitude |
---|
1892 | lon_bound(i)=(longitudes(i)+1.0)*pi/180.0 |
---|
1893 | enddo |
---|
1894 | ! extra 'modulo' value |
---|
1895 | lon_bound(nblon+1)=lon_bound(1)+2.0*pi |
---|
1896 | |
---|
1897 | ! latitude boundaries (in radians): |
---|
1898 | do j=1,nblat-1 |
---|
1899 | ! NB: Mons data is every 2 degrees in latitude |
---|
1900 | lat_bound(j)=(latitudes(j)-1.0)*pi/180.0 |
---|
1901 | enddo |
---|
1902 | |
---|
1903 | ! MONS datasets: |
---|
1904 | do j=1,nblat |
---|
1905 | Hdnx(1:nblon,j)=Hdn(1:nblon,j) |
---|
1906 | Hdnx(nblon+1,j)=Hdnx(1,j) |
---|
1907 | d21x(1:nblon,j)=d21(1:nblon,j) |
---|
1908 | d21x(nblon+1,j)=d21x(1,j) |
---|
1909 | enddo |
---|
1910 | |
---|
1911 | ! Interpolate onto GCM grid |
---|
1912 | call interp_horiz(Hdnx,MONS_Hdn,nblon,nblat-1,iim,jjm,1, |
---|
1913 | & lon_bound,lat_bound,rlonu,rlatv) |
---|
1914 | call interp_horiz(d21x,MONS_d21,nblon,nblat-1,iim,jjm,1, |
---|
1915 | & lon_bound,lat_bound,rlonu,rlatv) |
---|
1916 | |
---|
1917 | end subroutine |
---|