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

Contents of /trunk/dyn3d/gcm.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 266 - (show annotations)
Thu Apr 19 17:54:55 2018 UTC (6 years ago) by guez
File size: 3036 byte(s)
Define macros of the preprocessor CPP_IIM, CPP_JJM, CPP_LLM so we can
control the resolution from the compilation command, and automate
compilation for several resolutions.

In module yoethf_m, transform variables into named constants. So we do
not need procedure yoethf any longer.

Bug fix in program test_inter_barxy, missing calls to fyhyp and fxhyp,
and definition of rlatu.

Remove variable iecri of module conf_gcm_m. The files dyn_hist*.nc are
written every time step. We are simplifying the output system, pending
replacement by a whole new system.

Modify possible value of vert_sampling from "param" to
"strato_custom", following LMDZ. Default values of corresponding
namelist variables are now the values used for LMDZ CMIP6.

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: dtvr, iniconst
12 use comdissnew, only: read_comdissnew
13 use comgeom, only: aire_2d, inigeom
14 use comgeomphy, only: airephy
15 use conf_gcm_m, only: day_step, iperiod, iphysiq, nday, conf_gcm, iflag_phys
16 use conf_guide_m, only: conf_guide
17 use dimensions, 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 inithist_m, only: inithist
27 use init_dynzon_m, only: init_dynzon
28 USE ioconf_calendar_m, only: ioconf_calendar
29 use jumble, only: new_unit
30 use leapfrog_m, only: leapfrog
31 use netcdf95, only: nf95_close
32 use suphec_m, only: suphec
33 use unit_nml_m, only: unit_nml
34 use createnewfield_m, only: NbField, Ncid
35
36 IMPLICIT NONE
37
38 ! Variables dynamiques :
39 REAL ucov(iim + 1, jjm + 1, llm), vcov(iim + 1, jjm, llm) ! vent covariant
40 REAL teta(iim + 1, jjm + 1, llm) ! temp\'erature potentielle
41 REAL q(iim + 1, jjm + 1, llm, nqmx) ! champs advect\'es
42 REAL ps(iim + 1, jjm + 1) ! pression au sol (Pa)
43 REAL masse(iim + 1, jjm + 1, llm) ! masse d'air
44 REAL phis(iim + 1, jjm + 1) ! g\'eopotentiel au sol
45
46 LOGICAL:: true_calendar = .false. ! default value
47 integer i
48
49 namelist /main_nml/true_calendar
50
51 !------------------------------------------------------------
52
53 call new_unit(unit_nml)
54 open(unit_nml, file="used_namelists.txt", status="replace", action="write")
55
56 CALL conf_gcm
57 call read_comdissnew
58
59 print *, "Enter namelist 'main_nml'."
60 read (unit=*, nml=main_nml)
61 write(unit_nml, nml=main_nml)
62
63 ! Choix du calendrier :
64 if (true_calendar) then
65 call ioconf_calendar('gregorian')
66 else
67 call ioconf_calendar('360d')
68 endif
69
70 call iniadvtrac
71 CALL iniconst
72 CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis)
73 CALL disvert
74 CALL inigeom ! initialisation de la g\'eometrie
75 CALL inifilr ! initialisation du filtre
76 CALL inidissip
77 call init_dyn_phy
78
79 ! Initialisation de la physique :
80 IF (iflag_phys) THEN
81 airephy = pack(aire_2d, dyn_phy)
82 CALL suphec
83 ENDIF
84
85 ! Initialisation des entr\'ees-sorties :
86 CALL dynredem0(day_ini + nday, phis)
87 CALL inithist(t_ops = dtvr, t_wrt = dtvr)
88 call init_dynzon(dt_app = dtvr * iperiod)
89
90 CALL conf_guide
91 CALL leapfrog(ucov, vcov, teta, ps, masse, phis, q)
92
93 close(unit_nml)
94 call histclo
95
96 do i = 1, nbfield
97 call nf95_close(Ncid(i))
98 end do
99
100 print *, 'Simulation finished'
101 print *, 'Everything is cool'
102
103 END PROGRAM gcm

  ViewVC Help
Powered by ViewVC 1.1.21