1 | c======================================================================= |
---|
2 | SUBROUTINE tabfi(ngrid,nid,Lmodif,tab0,day_ini,lmax,p_rad, |
---|
3 | . p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) |
---|
4 | c======================================================================= |
---|
5 | c |
---|
6 | c C. Hourdin 15/11/96 |
---|
7 | c |
---|
8 | c Object: Lecture du tab_cntrl physique dans un fichier |
---|
9 | c ------ et initialisation des constantes physiques |
---|
10 | c |
---|
11 | c Arguments: |
---|
12 | c ---------- |
---|
13 | c |
---|
14 | c Inputs: |
---|
15 | c ------ |
---|
16 | c |
---|
17 | c - nid: unitne logique du fichier ou on va lire le tab_cntrl |
---|
18 | c (ouvert dans le programme appellant) |
---|
19 | c |
---|
20 | c si nid=0: |
---|
21 | c pas de lecture du tab_cntrl mais |
---|
22 | c Valeurs par default des constantes physiques |
---|
23 | c |
---|
24 | c - tab0: Offset de tab_cntrl a partir duquel sont ranges |
---|
25 | c les parametres physiques (50 pour start_archive) |
---|
26 | c |
---|
27 | c - Lmodif: si on souhaite modifier les constantes Lmodif = 1 = TRUE |
---|
28 | c |
---|
29 | c |
---|
30 | c Outputs: |
---|
31 | c -------- |
---|
32 | c |
---|
33 | c - day_ini: tab_cntrl(tab0+3) (Dans les cas ou l'on souhaite |
---|
34 | c comparer avec le day_ini dynamique) |
---|
35 | c |
---|
36 | c - lmax: tab_cntrl(tab0+2) (pour test avec nlayer) |
---|
37 | c |
---|
38 | c - p_rad |
---|
39 | c - p_omeg ! |
---|
40 | c - p_g ! Constantes physiques ayant des |
---|
41 | c - p_mugaz ! homonymes dynamiques |
---|
42 | c - p_daysec ! |
---|
43 | c |
---|
44 | c======================================================================= |
---|
45 | ! to use 'getin' |
---|
46 | use ioipsl_getincom , only: getin |
---|
47 | |
---|
48 | use surfdat_h, only: albedice, emisice, iceradius, dtemisice, |
---|
49 | & emissiv |
---|
50 | use comsoil_h, only: volcapa |
---|
51 | use iostart, only: get_var |
---|
52 | use mod_phys_lmdz_para, only: is_parallel |
---|
53 | use planete_mod, only: year_day, periastr, apoastr, peri_day, |
---|
54 | & obliquit, z0, lmixmin, emin_turb |
---|
55 | use comcstfi_mod, only: rad, omeg, g, mugaz, rcp, cpp, dtphys, |
---|
56 | & daysec, r |
---|
57 | use callkeys_mod, only: check_cpp_match,force_cpp |
---|
58 | implicit none |
---|
59 | |
---|
60 | #include "netcdf.inc" |
---|
61 | |
---|
62 | c----------------------------------------------------------------------- |
---|
63 | c Declarations |
---|
64 | c----------------------------------------------------------------------- |
---|
65 | |
---|
66 | c Arguments |
---|
67 | c --------- |
---|
68 | INTEGER,INTENT(IN) :: ngrid,nid,tab0 |
---|
69 | INTEGER*4,INTENT(OUT) :: day_ini |
---|
70 | INTEGER,INTENT(IN) :: Lmodif |
---|
71 | INTEGER,INTENT(OUT) :: lmax |
---|
72 | REAL,INTENT(OUT) :: p_rad,p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time |
---|
73 | |
---|
74 | c Variables |
---|
75 | c --------- |
---|
76 | INTEGER,PARAMETER :: length=100 |
---|
77 | REAL tab_cntrl(length) ! array in which are stored the run's parameters |
---|
78 | INTEGER ierr,nvarid |
---|
79 | INTEGER size |
---|
80 | CHARACTER modif*20 |
---|
81 | LOGICAL :: found |
---|
82 | |
---|
83 | write(*,*)"tabfi: nid=",nid," tab0=",tab0," Lmodif=",Lmodif |
---|
84 | |
---|
85 | IF (nid.eq.0) then |
---|
86 | c----------------------------------------------------------------------- |
---|
87 | c Initialization of various physical constants to defaut values (nid = 0 case) |
---|
88 | c----------------------------------------------------------------------- |
---|
89 | ELSE |
---|
90 | c----------------------------------------------------------------------- |
---|
91 | c Initialization of physical constants by reading array tab_cntrl(:) |
---|
92 | c which contains these parameters (nid != 0 case) |
---|
93 | c----------------------------------------------------------------------- |
---|
94 | c Read 'controle' array |
---|
95 | c |
---|
96 | |
---|
97 | call get_var("controle",tab_cntrl,found) |
---|
98 | if (.not.found) then |
---|
99 | write(*,*)"tabfi: Failed reading <controle> array" |
---|
100 | call abort |
---|
101 | else |
---|
102 | write(*,*)'tabfi: tab_cntrl',tab_cntrl |
---|
103 | endif |
---|
104 | c |
---|
105 | c Initialization of some physical constants |
---|
106 | c informations on physics grid |
---|
107 | ! if(ngrid.ne.tab_cntrl(tab0+1)) then |
---|
108 | ! print*,'tabfi: WARNING !!! tab_cntrl(tab0+1).ne.ngrid' |
---|
109 | ! print*,tab_cntrl(tab0+1),ngrid |
---|
110 | ! endif |
---|
111 | lmax = nint(tab_cntrl(tab0+2)) |
---|
112 | day_ini = tab_cntrl(tab0+3) |
---|
113 | time = tab_cntrl(tab0+4) |
---|
114 | write (*,*) 'IN tabfi day_ini=',day_ini |
---|
115 | c Informations about planet for dynamics and physics |
---|
116 | rad = tab_cntrl(tab0+5) |
---|
117 | omeg = tab_cntrl(tab0+6) |
---|
118 | g = tab_cntrl(tab0+7) |
---|
119 | mugaz = tab_cntrl(tab0+8) |
---|
120 | rcp = tab_cntrl(tab0+9) |
---|
121 | cpp=(8.314511/(mugaz/1000.0))/rcp |
---|
122 | daysec = tab_cntrl(tab0+10) |
---|
123 | dtphys = tab_cntrl(tab0+11) |
---|
124 | c Informations about planet for the physics only |
---|
125 | year_day = tab_cntrl(tab0+14) |
---|
126 | periastr = tab_cntrl(tab0+15) |
---|
127 | apoastr = tab_cntrl(tab0+16) |
---|
128 | peri_day = tab_cntrl(tab0+17) |
---|
129 | obliquit = tab_cntrl(tab0+18) |
---|
130 | c boundary layer and turbeulence |
---|
131 | z0 = tab_cntrl(tab0+19) |
---|
132 | lmixmin = tab_cntrl(tab0+20) |
---|
133 | emin_turb = tab_cntrl(tab0+21) |
---|
134 | c optical properties of polar caps and ground emissivity |
---|
135 | albedice(1)= tab_cntrl(tab0+22) |
---|
136 | albedice(2)= tab_cntrl(tab0+23) |
---|
137 | emisice(1) = tab_cntrl(tab0+24) |
---|
138 | emisice(2) = tab_cntrl(tab0+25) |
---|
139 | emissiv = tab_cntrl(tab0+26) |
---|
140 | iceradius(1)= tab_cntrl(tab0+31) ! mean scat radius of CO2 snow (north) |
---|
141 | iceradius(2)= tab_cntrl(tab0+32) ! mean scat radius of CO2 snow (south) |
---|
142 | dtemisice(1)= tab_cntrl(tab0+33) !time scale for snow metamorphism (north) |
---|
143 | dtemisice(2)= tab_cntrl(tab0+34) !time scale for snow metamorphism (south) |
---|
144 | c soil properties |
---|
145 | volcapa = tab_cntrl(tab0+35) ! volumetric heat capacity |
---|
146 | c----------------------------------------------------------------------- |
---|
147 | c Save some constants for later use (as routine arguments) |
---|
148 | c----------------------------------------------------------------------- |
---|
149 | p_omeg = omeg |
---|
150 | p_g = g |
---|
151 | p_cpp = cpp |
---|
152 | p_mugaz = mugaz |
---|
153 | p_daysec = daysec |
---|
154 | p_rad=rad |
---|
155 | |
---|
156 | ENDIF ! end of (nid = 0) |
---|
157 | |
---|
158 | c----------------------------------------------------------------------- |
---|
159 | c Write physical constants to output before modifying them |
---|
160 | c----------------------------------------------------------------------- |
---|
161 | |
---|
162 | 6 FORMAT(a20,e15.6,e15.6) |
---|
163 | 5 FORMAT(a20,f12.2,f12.2) |
---|
164 | |
---|
165 | write(*,*) '*****************************************************' |
---|
166 | write(*,*) 'Reading tab_cntrl when calling tabfi before changes' |
---|
167 | write(*,*) '*****************************************************' |
---|
168 | write(*,5) '(1) = ngrid?',tab_cntrl(tab0+1),float(ngrid) |
---|
169 | write(*,5) '(2) lmax',tab_cntrl(tab0+2),float(lmax) |
---|
170 | write(*,5) '(3) day_ini',tab_cntrl(tab0+3),float(day_ini) |
---|
171 | write(*,5) '(5) rad',tab_cntrl(tab0+5),rad |
---|
172 | write(*,5) '(10) daysec',tab_cntrl(tab0+10),daysec |
---|
173 | write(*,6) '(6) omeg',tab_cntrl(tab0+6),omeg |
---|
174 | write(*,5) '(7) g',tab_cntrl(tab0+7),g |
---|
175 | write(*,5) '(8) mugaz',tab_cntrl(tab0+8),mugaz |
---|
176 | write(*,5) '(9) rcp',tab_cntrl(tab0+9),rcp |
---|
177 | write(*,6) '(11) dtphys?',tab_cntrl(tab0+11),dtphys |
---|
178 | |
---|
179 | write(*,5) '(14) year_day',tab_cntrl(tab0+14),year_day |
---|
180 | write(*,5) '(15) periastr',tab_cntrl(tab0+15),periastr |
---|
181 | write(*,5) '(16) apoastr',tab_cntrl(tab0+16),apoastr |
---|
182 | write(*,5) '(17) peri_day',tab_cntrl(tab0+17),peri_day |
---|
183 | write(*,5) '(18) obliquit',tab_cntrl(tab0+18),obliquit |
---|
184 | |
---|
185 | write(*,6) '(19) z0',tab_cntrl(tab0+19),z0 |
---|
186 | write(*,6) '(21) emin_turb',tab_cntrl(tab0+21),emin_turb |
---|
187 | write(*,5) '(20) lmixmin',tab_cntrl(tab0+20),lmixmin |
---|
188 | |
---|
189 | write(*,5) '(26) emissiv',tab_cntrl(tab0+26),emissiv |
---|
190 | write(*,5) '(24) emisice(1)',tab_cntrl(tab0+24),emisice(1) |
---|
191 | write(*,5) '(25) emisice(2)',tab_cntrl(tab0+25),emisice(2) |
---|
192 | write(*,5) '(22) albedice(1)',tab_cntrl(tab0+22),albedice(1) |
---|
193 | write(*,5) '(23) albedice(2)',tab_cntrl(tab0+23),albedice(2) |
---|
194 | write(*,6) '(31) iceradius(1)',tab_cntrl(tab0+31),iceradius(1) |
---|
195 | write(*,6) '(32) iceradius(2)',tab_cntrl(tab0+32),iceradius(2) |
---|
196 | write(*,5) '(33) dtemisice(1)',tab_cntrl(tab0+33),dtemisice(1) |
---|
197 | write(*,5) '(34) dtemisice(2)',tab_cntrl(tab0+34),dtemisice(2) |
---|
198 | |
---|
199 | write(*,5) '(35) volcapa',tab_cntrl(tab0+35),volcapa |
---|
200 | |
---|
201 | write(*,*) |
---|
202 | write(*,*) 'Lmodif in tabfi!!!!!!!',Lmodif |
---|
203 | |
---|
204 | c----------------------------------------------------------------------- |
---|
205 | c Modifications... |
---|
206 | ! NB: Modifying controls should only be done by newstart, and in seq mode |
---|
207 | if ((Lmodif.eq.1).and.is_parallel) then |
---|
208 | write(*,*) "tabfi: Error modifying tab_control should", |
---|
209 | & " only happen in serial mode (eg: by newstart)" |
---|
210 | stop |
---|
211 | endif |
---|
212 | c----------------------------------------------------------------------- |
---|
213 | |
---|
214 | IF(Lmodif.eq.1) then |
---|
215 | |
---|
216 | write(*,*) |
---|
217 | write(*,*) 'Change values in tab_cntrl ? :' |
---|
218 | write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
219 | write(*,*) '(Current values given above)' |
---|
220 | write(*,*) |
---|
221 | write(*,*) '(3) day_ini : Initial day (=0 at Ls=0)' |
---|
222 | write(*,*) '(19) z0 : surface roughness (m)' |
---|
223 | write(*,*) '(21) emin_turb : minimal energy (PBL)' |
---|
224 | write(*,*) '(20) lmixmin : mixing length (PBL)' |
---|
225 | write(*,*) '(26) emissiv : ground emissivity' |
---|
226 | write(*,*) '(24 et 25) emisice : CO2 ice max emissivity ' |
---|
227 | write(*,*) '(22 et 23) albedice : CO2 ice cap albedos' |
---|
228 | write(*,*) '(31 et 32) iceradius : mean scat radius of CO2 snow' |
---|
229 | write(*,*) '(33 et 34) dtemisice : time scale for snow', |
---|
230 | & 'metamorphism' |
---|
231 | write(*,*) '(35) volcapa : soil volumetric heat capacity' |
---|
232 | write(*,*) '(18) obliquit : planet obliquity (deg)' |
---|
233 | write(*,*) '(17) peri_day : periastron date (sols since Ls=0)' |
---|
234 | write(*,*) '(15) periastr : min. star-planet dist (UA)' |
---|
235 | write(*,*) '(16) apoastr : max. star-planet (UA)' |
---|
236 | write(*,*) '(14) year_day : length of year (in sols)' |
---|
237 | write(*,*) '(5) rad : radius of the planet (m)' |
---|
238 | write(*,*) '(6) omeg : planet rotation rate (rad/s)' |
---|
239 | write(*,*) '(7) g : gravity (m/s2)' |
---|
240 | write(*,*) '(8) mugaz : molecular mass ' |
---|
241 | write(*,*) ' of the atmosphere (g/mol)' |
---|
242 | write(*,*) '(9) rcp : r/Cp' |
---|
243 | write(*,*) '(8)+(9) calc_cpp_mugaz : r/Cp and mugaz ' |
---|
244 | write(*,*) ' computed from gases.def' |
---|
245 | write(*,*) '(10) daysec : length of a sol (s)' |
---|
246 | write(*,*) |
---|
247 | |
---|
248 | |
---|
249 | do while(modif(1:1).ne.'hello') |
---|
250 | write(*,*) |
---|
251 | write(*,*) |
---|
252 | write(*,*) 'Changes to perform ?' |
---|
253 | write(*,*) ' (enter keyword or return )' |
---|
254 | write(*,*) |
---|
255 | read(*,fmt='(a20)') modif |
---|
256 | if (modif(1:1) .eq. ' ') goto 999 |
---|
257 | |
---|
258 | write(*,*) |
---|
259 | write(*,*) modif(1:len_trim(modif)) , ' : ' |
---|
260 | |
---|
261 | if (modif(1:len_trim(modif)) .eq. 'day_ini') then |
---|
262 | write(*,*) 'current value:',day_ini |
---|
263 | write(*,*) 'enter new value:' |
---|
264 | 101 read(*,*,iostat=ierr) day_ini |
---|
265 | if(ierr.ne.0) goto 101 |
---|
266 | write(*,*) ' ' |
---|
267 | write(*,*) 'day_ini (new value):',day_ini |
---|
268 | |
---|
269 | else if (modif(1:len_trim(modif)) .eq. 'z0') then |
---|
270 | write(*,*) 'current value:',z0 |
---|
271 | write(*,*) 'enter new value:' |
---|
272 | 102 read(*,*,iostat=ierr) z0 |
---|
273 | if(ierr.ne.0) goto 102 |
---|
274 | write(*,*) ' ' |
---|
275 | write(*,*) ' z0 (new value):',z0 |
---|
276 | |
---|
277 | else if (modif(1:len_trim(modif)) .eq. 'emin_turb') then |
---|
278 | write(*,*) 'current value:',emin_turb |
---|
279 | write(*,*) 'enter new value:' |
---|
280 | 103 read(*,*,iostat=ierr) emin_turb |
---|
281 | if(ierr.ne.0) goto 103 |
---|
282 | write(*,*) ' ' |
---|
283 | write(*,*) ' emin_turb (new value):',emin_turb |
---|
284 | |
---|
285 | else if (modif(1:len_trim(modif)) .eq. 'lmixmin') then |
---|
286 | write(*,*) 'current value:',lmixmin |
---|
287 | write(*,*) 'enter new value:' |
---|
288 | 104 read(*,*,iostat=ierr) lmixmin |
---|
289 | if(ierr.ne.0) goto 104 |
---|
290 | write(*,*) ' ' |
---|
291 | write(*,*) ' lmixmin (new value):',lmixmin |
---|
292 | |
---|
293 | else if (modif(1:len_trim(modif)) .eq. 'emissiv') then |
---|
294 | write(*,*) 'current value:',emissiv |
---|
295 | write(*,*) 'enter new value:' |
---|
296 | 105 read(*,*,iostat=ierr) emissiv |
---|
297 | if(ierr.ne.0) goto 105 |
---|
298 | write(*,*) ' ' |
---|
299 | write(*,*) ' emissiv (new value):',emissiv |
---|
300 | |
---|
301 | else if (modif(1:len_trim(modif)) .eq. 'emisice') then |
---|
302 | write(*,*) 'current value emisice(1) North:',emisice(1) |
---|
303 | write(*,*) 'enter new value:' |
---|
304 | 106 read(*,*,iostat=ierr) emisice(1) |
---|
305 | if(ierr.ne.0) goto 106 |
---|
306 | write(*,*) |
---|
307 | write(*,*) ' emisice(1) (new value):',emisice(1) |
---|
308 | write(*,*) |
---|
309 | |
---|
310 | write(*,*) 'current value emisice(2) South:',emisice(2) |
---|
311 | write(*,*) 'enter new value:' |
---|
312 | 107 read(*,*,iostat=ierr) emisice(2) |
---|
313 | if(ierr.ne.0) goto 107 |
---|
314 | write(*,*) |
---|
315 | write(*,*) ' emisice(2) (new value):',emisice(2) |
---|
316 | |
---|
317 | else if (modif(1:len_trim(modif)) .eq. 'albedice') then |
---|
318 | write(*,*) 'current value albedice(1) North:',albedice(1) |
---|
319 | write(*,*) 'enter new value:' |
---|
320 | 108 read(*,*,iostat=ierr) albedice(1) |
---|
321 | if(ierr.ne.0) goto 108 |
---|
322 | write(*,*) |
---|
323 | write(*,*) ' albedice(1) (new value):',albedice(1) |
---|
324 | write(*,*) |
---|
325 | |
---|
326 | write(*,*) 'current value albedice(2) South:',albedice(2) |
---|
327 | write(*,*) 'enter new value:' |
---|
328 | 109 read(*,*,iostat=ierr) albedice(2) |
---|
329 | if(ierr.ne.0) goto 109 |
---|
330 | write(*,*) |
---|
331 | write(*,*) ' albedice(2) (new value):',albedice(2) |
---|
332 | |
---|
333 | else if (modif(1:len_trim(modif)) .eq. 'iceradius') then |
---|
334 | write(*,*) 'current value iceradius(1) North:',iceradius(1) |
---|
335 | write(*,*) 'enter new value:' |
---|
336 | 110 read(*,*,iostat=ierr) iceradius(1) |
---|
337 | if(ierr.ne.0) goto 110 |
---|
338 | write(*,*) |
---|
339 | write(*,*) ' iceradius(1) (new value):',iceradius(1) |
---|
340 | write(*,*) |
---|
341 | |
---|
342 | write(*,*) 'current value iceradius(2) South:',iceradius(2) |
---|
343 | write(*,*) 'enter new value:' |
---|
344 | 111 read(*,*,iostat=ierr) iceradius(2) |
---|
345 | if(ierr.ne.0) goto 111 |
---|
346 | write(*,*) |
---|
347 | write(*,*) ' iceradius(2) (new value):',iceradius(2) |
---|
348 | |
---|
349 | else if (modif(1:len_trim(modif)) .eq. 'dtemisice') then |
---|
350 | write(*,*) 'current value dtemisice(1) North:',dtemisice(1) |
---|
351 | write(*,*) 'enter new value:' |
---|
352 | 112 read(*,*,iostat=ierr) dtemisice(1) |
---|
353 | if(ierr.ne.0) goto 112 |
---|
354 | write(*,*) |
---|
355 | write(*,*) ' dtemisice(1) (new value):',dtemisice(1) |
---|
356 | write(*,*) |
---|
357 | |
---|
358 | write(*,*) 'current value dtemisice(2) South:',dtemisice(2) |
---|
359 | write(*,*) 'enter new value:' |
---|
360 | 113 read(*,*,iostat=ierr) dtemisice(2) |
---|
361 | if(ierr.ne.0) goto 113 |
---|
362 | write(*,*) |
---|
363 | write(*,*) ' dtemisice(2) (new value):',dtemisice(2) |
---|
364 | |
---|
365 | else if (modif(1:len_trim(modif)) .eq. 'obliquit') then |
---|
366 | write(*,*) 'current value:',obliquit |
---|
367 | write(*,*) 'obliquit should be 25.19 on current Mars' |
---|
368 | write(*,*) 'enter new value:' |
---|
369 | 115 read(*,*,iostat=ierr) obliquit |
---|
370 | if(ierr.ne.0) goto 115 |
---|
371 | write(*,*) |
---|
372 | write(*,*) ' obliquit (new value):',obliquit |
---|
373 | |
---|
374 | else if (modif(1:len_trim(modif)) .eq. 'peri_day') then |
---|
375 | write(*,*) 'current value:',peri_day |
---|
376 | write(*,*) 'peri_day should be 485 on current Mars' |
---|
377 | write(*,*) 'enter new value:' |
---|
378 | 116 read(*,*,iostat=ierr) peri_day |
---|
379 | if(ierr.ne.0) goto 116 |
---|
380 | write(*,*) |
---|
381 | write(*,*) ' peri_day (new value):',peri_day |
---|
382 | |
---|
383 | else if (modif(1:len_trim(modif)) .eq. 'periastr') then |
---|
384 | write(*,*) 'current value:',periastr |
---|
385 | write(*,*) 'periastr should be 206.66 on present-day Mars' |
---|
386 | write(*,*) 'enter new value:' |
---|
387 | 117 read(*,*,iostat=ierr) periastr |
---|
388 | if(ierr.ne.0) goto 117 |
---|
389 | write(*,*) |
---|
390 | write(*,*) ' periastr (new value):',periastr |
---|
391 | |
---|
392 | else if (modif(1:len_trim(modif)) .eq. 'apoastr') then |
---|
393 | write(*,*) 'current value:',apoastr |
---|
394 | write(*,*) 'apoastr should be 249.22 on present-day Mars' |
---|
395 | write(*,*) 'enter new value:' |
---|
396 | 118 read(*,*,iostat=ierr) apoastr |
---|
397 | if(ierr.ne.0) goto 118 |
---|
398 | write(*,*) |
---|
399 | write(*,*) ' apoastr (new value):',apoastr |
---|
400 | |
---|
401 | else if (modif(1:len_trim(modif)) .eq. 'volcapa') then |
---|
402 | write(*,*) 'current value:',volcapa |
---|
403 | write(*,*) 'enter new value:' |
---|
404 | 119 read(*,*,iostat=ierr) volcapa |
---|
405 | if(ierr.ne.0) goto 119 |
---|
406 | write(*,*) |
---|
407 | write(*,*) ' volcapa (new value):',volcapa |
---|
408 | |
---|
409 | else if (modif(1:len_trim(modif)).eq.'rad') then |
---|
410 | write(*,*) 'current value:',rad |
---|
411 | write(*,*) 'enter new value:' |
---|
412 | 120 read(*,*,iostat=ierr) rad |
---|
413 | if(ierr.ne.0) goto 120 |
---|
414 | write(*,*) |
---|
415 | write(*,*) ' rad (new value):',rad |
---|
416 | |
---|
417 | else if (modif(1:len_trim(modif)).eq.'omeg') then |
---|
418 | write(*,*) 'current value:',omeg |
---|
419 | write(*,*) 'enter new value:' |
---|
420 | 121 read(*,*,iostat=ierr) omeg |
---|
421 | if(ierr.ne.0) goto 121 |
---|
422 | write(*,*) |
---|
423 | write(*,*) ' omeg (new value):',omeg |
---|
424 | |
---|
425 | else if (modif(1:len_trim(modif)).eq.'g') then |
---|
426 | write(*,*) 'current value:',g |
---|
427 | write(*,*) 'enter new value:' |
---|
428 | 122 read(*,*,iostat=ierr) g |
---|
429 | if(ierr.ne.0) goto 122 |
---|
430 | write(*,*) |
---|
431 | write(*,*) ' g (new value):',g |
---|
432 | |
---|
433 | else if (modif(1:len_trim(modif)).eq.'mugaz') then |
---|
434 | write(*,*) 'current value:',mugaz |
---|
435 | write(*,*) 'enter new value:' |
---|
436 | 123 read(*,*,iostat=ierr) mugaz |
---|
437 | if(ierr.ne.0) goto 123 |
---|
438 | write(*,*) |
---|
439 | write(*,*) ' mugaz (new value):',mugaz |
---|
440 | r=8.314511/(mugaz/1000.0) |
---|
441 | write(*,*) ' R (new value):',r |
---|
442 | |
---|
443 | else if (modif(1:len_trim(modif)).eq.'rcp') then |
---|
444 | write(*,*) 'current value:',rcp |
---|
445 | write(*,*) 'enter new value:' |
---|
446 | 124 read(*,*,iostat=ierr) rcp |
---|
447 | if(ierr.ne.0) goto 124 |
---|
448 | write(*,*) |
---|
449 | write(*,*) ' rcp (new value):',rcp |
---|
450 | r=8.314511/(mugaz/1000.0) |
---|
451 | cpp=r/rcp |
---|
452 | write(*,*) ' cpp (new value):',cpp |
---|
453 | |
---|
454 | else if (modif(1:len_trim(modif)).eq.'calc_cpp_mugaz') then |
---|
455 | write(*,*) 'current value rcp, mugaz:',rcp,mugaz |
---|
456 | check_cpp_match=.false. |
---|
457 | force_cpp=.false. |
---|
458 | call su_gases |
---|
459 | call calc_cpp_mugaz |
---|
460 | write(*,*) |
---|
461 | write(*,*) ' cpp (new value):',cpp |
---|
462 | write(*,*) ' mugaz (new value):',mugaz |
---|
463 | r=8.314511/(mugaz/1000.0) |
---|
464 | rcp=r/cpp |
---|
465 | write(*,*) ' rcp (new value):',rcp |
---|
466 | |
---|
467 | else if (modif(1:len_trim(modif)).eq.'daysec') then |
---|
468 | write(*,*) 'current value:',daysec |
---|
469 | write(*,*) 'enter new value:' |
---|
470 | 125 read(*,*,iostat=ierr) daysec |
---|
471 | if(ierr.ne.0) goto 125 |
---|
472 | write(*,*) |
---|
473 | write(*,*) ' daysec (new value):',daysec |
---|
474 | |
---|
475 | ! added by RW! |
---|
476 | else if (modif(1:len_trim(modif)).eq.'year_day') then |
---|
477 | write(*,*) 'current value:',year_day |
---|
478 | write(*,*) 'enter new value:' |
---|
479 | 126 read(*,*,iostat=ierr) year_day |
---|
480 | if(ierr.ne.0) goto 126 |
---|
481 | write(*,*) |
---|
482 | write(*,*) ' year_day (new value):',year_day |
---|
483 | |
---|
484 | endif |
---|
485 | enddo ! of do while(modif(1:1).ne.'hello') |
---|
486 | |
---|
487 | 999 continue |
---|
488 | |
---|
489 | c----------------------------------------------------------------------- |
---|
490 | c Write values of physical constants after modifications |
---|
491 | c----------------------------------------------------------------------- |
---|
492 | |
---|
493 | write(*,*) '*****************************************************' |
---|
494 | write(*,*) 'Reading tab_cntrl when calling tabfi AFTER changes' |
---|
495 | write(*,*) '*****************************************************' |
---|
496 | write(*,5) '(1) = ngrid?',tab_cntrl(tab0+1),float(ngrid) |
---|
497 | write(*,5) '(2) lmax',tab_cntrl(tab0+2),float(lmax) |
---|
498 | write(*,5) '(3) day_ini',tab_cntrl(tab0+3),float(day_ini) |
---|
499 | write(*,5) '(5) rad',tab_cntrl(tab0+5),rad |
---|
500 | write(*,5) '(10) daysec',tab_cntrl(tab0+10),daysec |
---|
501 | write(*,6) '(6) omeg',tab_cntrl(tab0+6),omeg |
---|
502 | write(*,5) '(7) g',tab_cntrl(tab0+7),g |
---|
503 | write(*,5) '(8) mugaz',tab_cntrl(tab0+8),mugaz |
---|
504 | write(*,5) '(9) rcp',tab_cntrl(tab0+9),rcp |
---|
505 | write(*,6) '(11) dtphys?',tab_cntrl(tab0+11),dtphys |
---|
506 | |
---|
507 | write(*,5) '(14) year_day',tab_cntrl(tab0+14),year_day |
---|
508 | write(*,5) '(15) periastr',tab_cntrl(tab0+15),periastr |
---|
509 | write(*,5) '(16) apoastr',tab_cntrl(tab0+16),apoastr |
---|
510 | write(*,5) '(17) peri_day',tab_cntrl(tab0+17),peri_day |
---|
511 | write(*,5) '(18) obliquit',tab_cntrl(tab0+18),obliquit |
---|
512 | |
---|
513 | write(*,6) '(19) z0',tab_cntrl(tab0+19),z0 |
---|
514 | write(*,6) '(21) emin_turb',tab_cntrl(tab0+21),emin_turb |
---|
515 | write(*,5) '(20) lmixmin',tab_cntrl(tab0+20),lmixmin |
---|
516 | |
---|
517 | write(*,5) '(26) emissiv',tab_cntrl(tab0+26),emissiv |
---|
518 | write(*,5) '(24) emisice(1)',tab_cntrl(tab0+24),emisice(1) |
---|
519 | write(*,5) '(25) emisice(2)',tab_cntrl(tab0+25),emisice(2) |
---|
520 | write(*,5) '(22) albedice(1)',tab_cntrl(tab0+22),albedice(1) |
---|
521 | write(*,5) '(23) albedice(2)',tab_cntrl(tab0+23),albedice(2) |
---|
522 | write(*,6) '(31) iceradius(1)',tab_cntrl(tab0+31),iceradius(1) |
---|
523 | write(*,6) '(32) iceradius(2)',tab_cntrl(tab0+32),iceradius(2) |
---|
524 | write(*,5) '(33) dtemisice(1)',tab_cntrl(tab0+33),dtemisice(1) |
---|
525 | write(*,5) '(34) dtemisice(2)',tab_cntrl(tab0+34),dtemisice(2) |
---|
526 | |
---|
527 | write(*,5) '(35) volcapa',tab_cntrl(tab0+35),volcapa |
---|
528 | |
---|
529 | write(*,*) |
---|
530 | write(*,*) |
---|
531 | |
---|
532 | ENDIF ! of if (Lmodif == 1) |
---|
533 | |
---|
534 | c----------------------------------------------------------------------- |
---|
535 | c Save some constants for later use (as routine arguments) |
---|
536 | c----------------------------------------------------------------------- |
---|
537 | p_omeg = omeg |
---|
538 | p_g = g |
---|
539 | p_cpp = cpp |
---|
540 | p_mugaz = mugaz |
---|
541 | p_daysec = daysec |
---|
542 | p_rad=rad |
---|
543 | |
---|
544 | |
---|
545 | end |
---|