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

Contents of /trunk/dyn3d/gcm.f

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.21