/[lmdze]/trunk/dyn3d/gcm.f
ViewVC logotype

Annotation of /trunk/dyn3d/gcm.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 178 - (hide annotations)
Fri Mar 11 18:47:26 2016 UTC (8 years, 2 months ago) by guez
Original Path: trunk/Sources/dyn3d/gcm.f
File size: 3398 byte(s)
Moved variables date0, deltat, datasz_max, ncvar_ids, point, buff_pos,
buffer, regular from module histcom_var to modules where they are
defined.

Removed procedure ioipslmpp, useless for a sequential program.

Added argument datasz_max to histwrite_real (to avoid circular
dependency with histwrite).

Removed useless variables and computations everywhere.

Changed real litteral constants from default kind to double precision
in lwb, lwu, lwvn, sw1s, swtt, swtt1, swu.

Removed unused arguments: paer of sw, sw1s, sw2s, swclr; pcldsw of
sw1s, sw2s; pdsig, prayl of swr; co2_ppm of clmain, clqh; tsol of
transp_lay; nsrf of screenp; kcrit and kknu of gwstress; pstd of
orosetup.

Added output of relative humidity.

1 guez 3 PROGRAM gcm
2    
3 guez 36 ! Authors: P. Le Van, L. Fairhead, F. Hourdin
4     ! From "gcm.F", version 1.4, 2006/04/04 15:05:16
5 guez 3
6 guez 139 ! General circulation model of LMD. Avec coordonn\'ee verticale
7     ! hybride, avec nouveaux op\'erateurs de dissipation "*" ("gradiv2",
8     ! "divgrad2", "nxgraro2"). Possibilit\'e de choisir le sch\'ema pour
9 guez 38 ! l'advection de "q", en modifiant "iadv" dans "traceur.def".
10    
11 guez 79 use comconst, only: daysec, dtvr, iniconst
12 guez 168 use comgeom, only: aire_2d, inigeom
13     use comgeomphy, only: airephy
14 guez 129 use conf_gcm_m, only: day_step, iperiod, iecri, iphysiq, nday, periodav, &
15     conf_gcm, iflag_phys
16 guez 115 use conf_guide_m, only: conf_guide
17 guez 26 use dimens_m, only: iim, jjm, llm, nqmx
18 guez 79 USE disvert_m, ONLY : disvert
19 guez 168 use dynetat0_m, only: dynetat0, day_ini
20 guez 26 use dynredem0_m, only: dynredem0
21 guez 3 use grid_change, only: dyn_phy, init_dyn_phy
22 guez 61 use histclo_m, only: histclo
23 guez 18 use iniadvtrac_m, only: iniadvtrac
24 guez 26 use inidissip_m, only: inidissip
25 guez 54 use inifilr_m, only: inifilr
26 guez 26 use initdynav_m, only: initdynav
27     use inithist_m, only: inithist
28 guez 57 use init_dynzon_m, only: init_dynzon
29 guez 92 USE ioconf_calendar_m, only: ioconf_calendar
30 guez 57 use jumble, only: new_unit
31 guez 3 use leapfrog_m, only: leapfrog
32 guez 108 use netcdf95, only: nf95_close
33 guez 37 use suphec_m, only: suphec
34 guez 26 use tracstoke, only: istdyn, istphy
35 guez 57 use unit_nml_m, only: unit_nml
36 guez 38 use yoethf_m, only: yoethf
37 guez 110 use createnewfield_m, only: NbField, Ncid
38 guez 3
39     IMPLICIT NONE
40    
41     ! Variables dynamiques :
42 guez 55 REAL ucov(iim + 1, jjm + 1, llm), vcov(iim + 1, jjm, llm) ! vent covariant
43 guez 139 REAL teta(iim + 1, jjm + 1, llm) ! temp\'erature potentielle
44     REAL q(iim + 1, jjm + 1, llm, nqmx) ! champs advect\'es
45 guez 39 REAL ps(iim + 1, jjm + 1) ! pression au sol (Pa)
46 guez 55 REAL masse(iim + 1, jjm + 1, llm) ! masse d'air
47 guez 139 REAL phis(iim + 1, jjm + 1) ! g\'eopotentiel au sol
48 guez 3
49     LOGICAL:: true_calendar = .false. ! default value
50 guez 108 integer i
51    
52 guez 3 namelist /main_nml/true_calendar
53    
54     !------------------------------------------------------------
55    
56 guez 57 call new_unit(unit_nml)
57 guez 79 open(unit_nml, file="used_namelists.txt", status="replace", action="write")
58 guez 57
59     CALL conf_gcm
60    
61 guez 3 print *, "Enter namelist 'main_nml'."
62     read (unit=*, nml=main_nml)
63 guez 57 write(unit_nml, nml=main_nml)
64 guez 3
65     ! Choix du calendrier :
66     if (true_calendar) then
67     call ioconf_calendar('gregorian')
68     else
69     call ioconf_calendar('360d')
70     endif
71    
72 guez 23 call iniadvtrac
73 guez 79 CALL iniconst
74 guez 128 CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis)
75 guez 79 CALL disvert
76 guez 139 CALL inigeom ! initialisation de la g\'eometrie
77 guez 36 CALL inifilr ! initialisation du filtre
78 guez 27 CALL inidissip
79 guez 3 call init_dyn_phy
80    
81     ! Initialisation de la physique :
82     IF (iflag_phys == 1) THEN
83 guez 37 airephy = pack(aire_2d, dyn_phy)
84     CALL suphec
85 guez 38 call yoethf
86 guez 3 ENDIF
87    
88 guez 139 ! Initialisation des entr\'ees-sorties :
89 guez 157 CALL dynredem0(day_ini + nday, phis)
90 guez 129 CALL inithist(dtvr, nqmx, t_ops = iecri * daysec, t_wrt = iecri * daysec)
91     CALL initdynav(dtvr, nqmx, t_ops = iperiod * dtvr, t_wrt = periodav * daysec)
92 guez 57 call init_dynzon(dt_app = dtvr * iperiod)
93 guez 3
94 guez 139 ! Choix des fr\'equences de stockage pour le hors-ligne :
95 guez 36 istdyn = day_step / 4 ! stockage toutes les 6 h = 1 jour / 4
96 guez 3 istphy = istdyn / iphysiq
97    
98 guez 115 CALL conf_guide
99 guez 128 CALL leapfrog(ucov, vcov, teta, ps, masse, phis, q)
100 guez 3
101 guez 68 close(unit_nml)
102 guez 10 call histclo
103 guez 108
104     do i = 1, nbfield
105 guez 109 call nf95_close(Ncid(i))
106 guez 108 end do
107    
108 guez 10 print *, 'Simulation finished'
109     print *, 'Everything is cool'
110    
111 guez 3 END PROGRAM gcm

  ViewVC Help
Powered by ViewVC 1.1.21