-
Notifications
You must be signed in to change notification settings - Fork 3
/
def_nml.f90
168 lines (133 loc) · 6.41 KB
/
def_nml.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
subroutine def_nml
!---------------------------------------------------------------------------
! !
! Copyright 2018 Anna Teruzzi, OGS, Trieste !
! !
! This file is part of 3DVarBio.
! 3DVarBio is based on OceanVar (Dobricic, 2006) !
! !
! 3DVarBio is free software: you can redistribute it and/or modify. !
! it under the terms of the GNU General Public License as published by !
! the Free Software Foundation, either version 3 of the License, or !
! (at your option) any later version. !
! !
! 3DVarBio is distributed in the hope that it will be useful, !
! but WITHOUT ANY WARRANTY; without even the implied warranty of !
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the !
! GNU General Public License for more details. !
! !
! You should have received a copy of the GNU General Public License !
! along with OceanVar. If not, see <http://www.gnu.org/licenses/>. !
! !
!---------------------------------------------------------------------------
!-----------------------------------------------------------------------
! !
! Define analysis parameters from namelists !
! !
! Version 1: A. Teruzzi 2018 !
!-----------------------------------------------------------------------
use set_knd
use drv_str
use grd_str
use obs_str
use eof_str
use cns_str
use ctl_str
use mpi_str
use bio_str
implicit none
LOGICAL :: read_eof, ApplyConditions
INTEGER(i4) :: neof, nreg, rcf_ntr
INTEGER(i4) :: ctl_m, bio_assim
INTEGER(i4) :: biol, bphy, nphyto, uniformL, anisL, verbose
REAL(r8) :: rcf_L, ctl_tol, ctl_per, rcf_efc, chl_dep
INTEGER(i4) :: argo, sat_obs, ncmp
NAMELIST /ctllst/ ctl_tol, ctl_per
NAMELIST /covlst/ neof, nreg, read_eof, rcf_ntr, rcf_L, rcf_efc
NAMELIST /biolst/ bio_assim, nphyto, chl_dep, ncmp, ApplyConditions
NAMELIST /params/ sat_obs, argo, uniformL, anisL, verbose
! -------------------------------------------------------------------
! Open a formatted file for the diagnostics
! ---
drv%dia = 12
if(MyId .eq. 0) then
open ( drv%dia, file='BioVar.diagnostics', form='formatted' )
endif
!---------------------------------------------------------------------
! Open the namelist
! ---
open(11,file='var_3d_nml',form='formatted')
! ---
read(11,ctllst)
if(MyId .eq. 0) then
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ' '
write(drv%dia,*) ' NAMELISTS: '
write(drv%dia,*) ' '
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ' MINIMIZER NAMELIST INPUT: '
write(drv%dia,*) ' Number of saved vectors: ctl_m = ', ctl_m
write(drv%dia,*) ' Minimum gradient of J: ctl_tol = ', ctl_tol
write(drv%dia,*) ' Percentage of initial gradient: ctl_per = ', ctl_per
endif
! ctl%m = ctl_m
ctl%pgtol = ctl_tol
ctl%pgper = ctl_per
! ---
read(11,covlst)
if(MyId .eq. 0) then
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ' COVARIANCE NAMELIST INPUT: '
write(drv%dia,*) ' Number of EOFs: neof = ', neof
write(drv%dia,*) ' Number of regions: nreg = ', nreg
write(drv%dia,*) ' Read EOFs from a file: read_eof = ', read_eof
write(drv%dia,*) ' Half number of iterations: rcf_ntr = ', rcf_ntr
write(drv%dia,*) ' Horizontal correlation radius: rcf_L = ', rcf_L
write(drv%dia,*) ' Extension factor for coastlines: rcf_efc = ', rcf_efc
endif
ros%neof = neof
ros%nreg = nreg
ros%read_eof = read_eof
rcf%ntr = rcf_ntr
rcf%L = rcf_L
rcf%efc = rcf_efc
! ---
read(11,biolst)
if(MyId .eq. 0) then
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ' BIOLOGY NAMELIST INPUT: '
write(drv%dia,*) ' Biological repartition of the chlorophyll = ', bio_assim
write(drv%dia,*) ' Number of phytoplankton species nphyt = ', nphyto
write(drv%dia,*) ' Minimum depth for chlorophyll chl_dep = ', chl_dep
write(drv%dia,*) ' Number of phytoplankton components ncmp = ', ncmp
write(drv%dia,*) ' Apply conditions flag ApplyConditions = ', ApplyConditions
endif
drv%bio_assim = bio_assim
bio%nphy = nphyto
sat%dep = chl_dep
bio%ncmp = ncmp
bio%ApplyConditions = ApplyConditions
read(11,params)
if(MyId .eq. 0) then
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ' PARAMETERS NAMELIST INPUT: '
write(drv%dia,*) ' Read Satellite observations sat_obs = ', sat_obs
write(drv%dia,*) ' Read ARGO float observations argo = ', argo
write(drv%dia,*) ' Set uniform correlation radius uniformL = ', uniformL
write(drv%dia,*) ' Set anisotropy on corr radius anisL = ', anisL
write(drv%dia,*) ' Add verbose on standard output verbose = ', verbose
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ''
endif
close(11)
drv%sat_obs = sat_obs
drv%argo_obs = argo
drv%uniformL = uniformL
drv%anisL = anisL
drv%Verbose = verbose
end subroutine def_nml