Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
getm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knut Klingbeil
getm
Commits
442417ac
Commit
442417ac
authored
Nov 12, 2010
by
Karsten Bolding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
numeric/physical mixing analysis added - Renneu and Hofmeister
parent
aebb3bb4
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
338 additions
and
6 deletions
+338
-6
schemas/getm-1.9.defaults
schemas/getm-1.9.defaults
+3
-0
schemas/getm-1.9.schema
schemas/getm-1.9.schema
+1
-0
src/3d/Makefile
src/3d/Makefile
+5
-2
src/3d/dynamic_allocations_3d.h
src/3d/dynamic_allocations_3d.h
+24
-0
src/3d/dynamic_declarations_3d.h
src/3d/dynamic_declarations_3d.h
+4
-0
src/3d/salinity.F90
src/3d/salinity.F90
+23
-1
src/3d/static_3d.h
src/3d/static_3d.h
+9
-0
src/3d/temperature.F90
src/3d/temperature.F90
+23
-1
src/3d/variables_3d.F90
src/3d/variables_3d.F90
+3
-0
src/futils/getm_timers.F90
src/futils/getm_timers.F90
+2
-0
src/ncdf/init_3d_ncdf.F90
src/ncdf/init_3d_ncdf.F90
+33
-0
src/ncdf/init_mean_ncdf.F90
src/ncdf/init_mean_ncdf.F90
+57
-0
src/ncdf/ncdf_3d.F90
src/ncdf/ncdf_3d.F90
+3
-0
src/ncdf/ncdf_mean.F90
src/ncdf/ncdf_mean.F90
+3
-0
src/ncdf/save_3d_ncdf.F90
src/ncdf/save_3d_ncdf.F90
+22
-0
src/ncdf/save_mean_ncdf.F90
src/ncdf/save_mean_ncdf.F90
+48
-0
src/output/calc_mean_fields.F90
src/output/calc_mean_fields.F90
+56
-1
src/output/diagnostic_variables.F90
src/output/diagnostic_variables.F90
+10
-0
src/output/output.F90
src/output/output.F90
+9
-1
No files found.
schemas/getm-1.9.defaults
View file @
442417ac
...
...
@@ -493,6 +493,9 @@
<save_taub>
False
</save_taub>
<save_mix_analysis>
False
</save_mix_analysis>
<first_2d>
0
</first_2d>
...
...
schemas/getm-1.9.schema
View file @
442417ac
...
...
@@ -608,6 +608,7 @@
<element
name=
"save_nuh"
type=
"bool"
label=
"save turbulent diffusivity of heat"
/>
<element
name=
"save_ss_nn"
type=
"bool"
label=
"save shear stress and Brunt-Vaisala frequency"
/>
<element
name=
"save_taub"
type=
"bool"
label=
"save bottom friction velocity"
/>
<element
name=
"save_mix_analysis"
type=
"bool"
label=
"calculate/save mixing analysis"
/>
<element
name=
"first_2d"
type=
"int"
label=
"first time step to save 2D fields"
unit=
"micro time steps"
minInclusive=
"0"
/>
<element
name=
"step_2d"
type=
"int"
label=
"interval between saves of 2D fields"
unit=
"micro time steps"
minInclusive=
"1"
/>
<element
name=
"first_3d"
type=
"int"
label=
"first time step to save 3D fields"
unit=
"micro time steps"
minInclusive=
"0"
/>
...
...
src/3d/Makefile
View file @
442417ac
...
...
@@ -13,7 +13,7 @@ MODSRC = m3d.F90 variables_3d.F90 advection_3d.F90 eqstate.F90 \
LIBSRC
=
start_macro.F90 hcc_check.F90 bdy_3d.F90 coordinates.F90 sigma_coordinates.F90 general_coordinates.F90 hybrid_coordinates.F90 check_h.F90 bottom_friction_3d.F90 internal_pressure.F90 uu_momentum_3d.F90 vv_momentum_3d.F90 ww_momentum_3d.F90 structure_friction_3d.F90 uv_advect_3d.F90 uv_diffusion_3d.F90 tke_eps_advect_3d.F90 stresses_3d.F90 ss_nn.F90 gotm.F90 slow_bottom_friction.F90 slow_advection.F90 slow_diffusion.F90 slow_terms.F90 divergence.F90 stop_macro.F90
TEXSRC
=
m3d.F90 variables_3d.F90 coordinates.F90 sigma_coordinates.F90 general_coordinates.F90 hybrid_coordinates.F90 check_h.F90 hcc_check.F90 uu_momentum_3d.F90 vv_momentum_3d.F90 ww_momentum_3d.F90 structure_friction_3d.F90 uv_advect_3d.F90 uv_diffusion_3d.F90 tke_eps_advect_3d.F90 bottom_friction_3d.F90 internal_pressure.F90 ip_blumberg_mellor.F90 ip_blumberg_mellor_lin.F90 ip_z_interpol.F90 ip_song_wright.F90 ip_chu_fan.F90 ip_shchepetkin_mcwilliams.F90 ip_stelling_vankester.F90 advection_3d.F90 upstream_adv.F90 upstream_2dh_adv.F90 u_split_adv.F90 v_split_adv.F90 w_split_adv.F90 w_split_it_adv.F90 fct_2dh_adv.F90 temperature.F90 salinity.F90 spm.F90 eqstate.F90 ss_nn.F90 stresses_3d.F90 gotm.F90 rivers.F90 bdy_3d.F90 slow_bottom_friction.F90 slow_advection.F90 slow_diffusion.F90 slow_terms.F90 start_macro.F90 stop_macro.F90 divergence.F90
TEXSRC
=
m3d.F90 variables_3d.F90 coordinates.F90 sigma_coordinates.F90 general_coordinates.F90 hybrid_coordinates.F90 check_h.F90 hcc_check.F90 uu_momentum_3d.F90 vv_momentum_3d.F90 ww_momentum_3d.F90 structure_friction_3d.F90 uv_advect_3d.F90 uv_diffusion_3d.F90 tke_eps_advect_3d.F90 bottom_friction_3d.F90 internal_pressure.F90 ip_blumberg_mellor.F90 ip_blumberg_mellor_lin.F90 ip_z_interpol.F90 ip_song_wright.F90 ip_chu_fan.F90 ip_shchepetkin_mcwilliams.F90 ip_stelling_vankester.F90
numerical_mixing..F90 physical_mixing.F90
advection_3d.F90 upstream_adv.F90 upstream_2dh_adv.F90 u_split_adv.F90 v_split_adv.F90 w_split_adv.F90 w_split_it_adv.F90 fct_2dh_adv.F90 temperature.F90 salinity.F90 spm.F90 eqstate.F90 ss_nn.F90 stresses_3d.F90 gotm.F90 rivers.F90 bdy_3d.F90 slow_bottom_friction.F90 slow_advection.F90 slow_diffusion.F90 slow_terms.F90 start_macro.F90 stop_macro.F90 divergence.F90
SRC
=
$(MODSRC)
$(LIBSRC)
...
...
@@ -55,6 +55,7 @@ OBJ += \
$(LIB)
(
structure_friction_3d.o
)
endif
OBJ
+=
\
OBJ +
=
\
$(LIB)
(
uv_advect_3d.o
)
\
$(LIB)
(
uv_diffusion_3d.o
)
ifneq
($(GETM_NO_BAROCLINIC),true)
...
...
@@ -65,7 +66,9 @@ $(LIB)(ip_z_interpol.o) \
$(LIB)
(
ip_song_wright.o
)
\
$(LIB)
(
ip_shchepetkin_mcwilliams.o
)
\
$(LIB)
(
ip_stelling_vankester.o
)
\
$(LIB)
(
ip_chu_fan.o
)
$(LIB)
(
ip_chu_fan.o
)
\
$(LIB)
(
numerical_mixing.o
)
\
$(LIB)
(
physical_mixing.o
)
endif
OBJ
+=
\
$(LIB)
(
eddyviscosity.o
)
\
...
...
src/3d/dynamic_allocations_3d.h
View file @
442417ac
...
...
@@ -79,6 +79,30 @@
allocate
(
rad
(
I3DFIELD
),
stat
=
rc
)
!
Solar
radiation
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
rad
)
'
allocate
(
nummix3d_S
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
nummix3d_S
)
'
allocate
(
nummix2d_S
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
nummix2d_S
)
'
allocate
(
nummix3d_T
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
nummix3d_T
)
'
allocate
(
nummix2d_T
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
nummix2d_T
)
'
allocate
(
phymix3d_S
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
phymix3d_S
)
'
allocate
(
phymix2d_S
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
phymix2d_S
)
'
allocate
(
phymix3d_T
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
phymix3d_T
)
'
allocate
(
phymix2d_T
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/=
0
)
stop
'
init_3d
:
Error
allocating
memory
(
phymix2d_T
)
'
#endif
#ifdef SPM
...
...
src/3d/dynamic_declarations_3d.h
View file @
442417ac
...
...
@@ -29,6 +29,10 @@
REALTYPE
,
dimension
(
:
,
:
,
:
),
allocatable
::
S
,
T
,
rho
,
buoy
REALTYPE
,
dimension
(
:
,
:
,
:
),
allocatable
::
idpdx
,
idpdy
REALTYPE
,
dimension
(
:
,
:
,
:
),
allocatable
::
rad
,
light
REALTYPE
,
dimension
(
:
,
:
,
:
),
allocatable
::
nummix3d_S
,
nummix3d_T
REALTYPE
,
dimension
(
:
,
:
,
:
),
allocatable
::
phymix3d_S
,
phymix3d_T
REALTYPE
,
dimension
(
:
,
:
),
allocatable
::
nummix2d_S
,
nummix2d_T
REALTYPE
,
dimension
(
:
,
:
),
allocatable
::
phymix2d_S
,
phymix2d_T
#endif
!
suspended
matter
...
...
src/3d/salinity.F90
View file @
442417ac
...
...
@@ -352,7 +352,10 @@ salt_field_no=1
use
domain
,
only
:
dx
,
dy
,
ard1
#endif
use
parameters
,
only
:
avmols
use
getm_timers
,
only
:
tic
,
toc
,
TIM_SALT
use
getm_timers
,
only
:
tic
,
toc
,
TIM_SALT
,
TIM_MIXANALYSIS
use
variables_3d
,
only
:
do_mixing_analysis
use
variables_3d
,
only
:
nummix3d_S
,
nummix2d_S
use
variables_3d
,
only
:
phymix3d_S
,
phymix2d_S
!$ use omp_lib
IMPLICIT
NONE
!
...
...
@@ -371,6 +374,7 @@ salt_field_no=1
#ifdef SALTWEDGE_TEST
REALTYPE
::
SRelax
,
kk
#endif
REALTYPE
::
S2
(
I3DFIELD
)
REALTYPE
::
delxu
(
I2DFIELD
),
delxv
(
I2DFIELD
)
REALTYPE
::
delyu
(
I2DFIELD
),
delyv
(
I2DFIELD
)
REALTYPE
::
area_inv
(
I2DFIELD
)
...
...
@@ -410,10 +414,28 @@ salt_field_no=1
! Note: do_advection_3d is timed separately, so we
! stop the present counter
call
toc
(
TIM_SALT
)
if
(
do_mixing_analysis
)
then
call
tic
(
TIM_MIXANALYSIS
)
S2
=
S
**
2
call
toc
(
TIM_MIXANALYSIS
)
call
do_advection_3d
(
dt
,
S2
,
uu
,
vv
,
ww
,
hun
,
hvn
,
ho
,
hn
,
&
delxu
,
delxv
,
delyu
,
delyv
,
area_inv
,
az
,
au
,
av
,
&
salt_hor_adv
,
salt_ver_adv
,
salt_adv_split
,
salt_AH
)
end
if
call
do_advection_3d
(
dt
,
S
,
uu
,
vv
,
ww
,
hun
,
hvn
,
ho
,
hn
,
&
delxu
,
delxv
,
delyu
,
delyv
,
area_inv
,
az
,
au
,
av
,
&
salt_hor_adv
,
salt_ver_adv
,
salt_adv_split
,
salt_AH
)
if
(
do_mixing_analysis
)
then
call
tic
(
TIM_MIXANALYSIS
)
call
numerical_mixing
(
S2
,
S
,
nummix3d_S
,
nummix2d_S
)
call
physical_mixing
(
S
,
nuh
+
avmols
,
phymix3d_S
,
phymix2d_S
)
call
toc
(
TIM_MIXANALYSIS
)
end
if
call
tic
(
TIM_SALT
)
#ifdef PECS_TEST
S
(
imin
:
imin
,
jmin
:
jmax
,
1
:
kmax
)
=
10
*
_
ONE_
...
...
src/3d/static_3d.h
View file @
442417ac
...
...
@@ -54,6 +54,15 @@
REALTYPE
::
idpdx
(
I3DFIELD
)
REALTYPE
::
idpdy
(
I3DFIELD
)
REALTYPE
::
light
(
I3DFIELD
)
REALTYPE
::
nummix3d_S
(
I3DFIELD
)
REALTYPE
::
nummix2d_S
(
I2DFIELD
)
REALTYPE
::
nummix3d_T
(
I3DFIELD
)
REALTYPE
::
nummix2d_T
(
I2DFIELD
)
REALTYPE
::
phymix3d_S
(
I3DFIELD
)
REALTYPE
::
phymix2d_S
(
I2DFIELD
)
REALTYPE
::
phymix3d_T
(
I3DFIELD
)
REALTYPE
::
phymix2d_T
(
I2DFIELD
)
#endif
#ifdef SPM
...
...
src/3d/temperature.F90
View file @
442417ac
...
...
@@ -338,7 +338,10 @@ temp_field_no=1
use
domain
,
only
:
dx
,
dy
,
ard1
#endif
use
parameters
,
only
:
avmolt
use
getm_timers
,
only
:
tic
,
toc
,
TIM_TEMP
use
getm_timers
,
only
:
tic
,
toc
,
TIM_TEMP
,
TIM_MIXANALYSIS
use
variables_3d
,
only
:
do_mixing_analysis
use
variables_3d
,
only
:
nummix3d_T
,
nummix2d_T
use
variables_3d
,
only
:
phymix3d_T
,
phymix2d_T
!$ use omp_lib
IMPLICIT
NONE
!
...
...
@@ -351,6 +354,7 @@ temp_field_no=1
!
! !LOCAL VARIABLES:
integer
::
i
,
j
,
k
,
rc
REALTYPE
::
T2
(
I3DFIELD
)
REALTYPE
::
delxu
(
I2DFIELD
),
delxv
(
I2DFIELD
)
REALTYPE
::
delyu
(
I2DFIELD
),
delyv
(
I2DFIELD
)
REALTYPE
::
area_inv
(
I2DFIELD
)
...
...
@@ -393,9 +397,27 @@ temp_field_no=1
! Note: do_advection_3d is timed separately, so we
! stop the present counter
call
toc
(
TIM_TEMP
)
if
(
do_mixing_analysis
)
then
call
tic
(
TIM_MIXANALYSIS
)
T2
=
T
**
2
call
toc
(
TIM_MIXANALYSIS
)
call
do_advection_3d
(
dt
,
T2
,
uu
,
vv
,
ww
,
hun
,
hvn
,
ho
,
hn
,
&
delxu
,
delxv
,
delyu
,
delyv
,
area_inv
,
az
,
au
,
av
,
&
temp_hor_adv
,
temp_ver_adv
,
temp_adv_split
,
temp_AH
)
end
if
call
do_advection_3d
(
dt
,
T
,
uu
,
vv
,
ww
,
hun
,
hvn
,
ho
,
hn
,
&
delxu
,
delxv
,
delyu
,
delyv
,
area_inv
,
az
,
au
,
av
,
&
temp_hor_adv
,
temp_ver_adv
,
temp_adv_split
,
temp_AH
)
if
(
do_mixing_analysis
)
then
call
tic
(
TIM_MIXANALYSIS
)
call
numerical_mixing
(
T2
,
T
,
nummix3d_T
,
nummix2d_T
)
call
physical_mixing
(
T
,
nuh
+
avmolt
,
phymix3d_T
,
phymix2d_T
)
call
toc
(
TIM_MIXANALYSIS
)
end
if
call
tic
(
TIM_TEMP
)
! OMP-NOTE: Pointer definitions and allocation so that each thread can
...
...
src/3d/variables_3d.F90
View file @
442417ac
...
...
@@ -119,6 +119,7 @@
REALTYPE
::
dt
,
cnpar
=
0.9
REALTYPE
::
avmback
=
_
ZERO_
,
avhback
=
_
ZERO_
character
(
len
=
64
)
::
adv_schemes
(
7
)
logical
::
do_mixing_analysis
=
.false.
!
#ifdef STATIC
#include "static_3d.h"
...
...
@@ -207,6 +208,8 @@
#ifndef NO_BAROCLINIC
idpdx
=
_
ZERO_
idpdy
=
_
ZERO_
nummix3d_S
=
_
ZERO_
;
nummix2d_S
=
_
ZERO_
nummix3d_T
=
_
ZERO_
;
nummix2d_T
=
_
ZERO_
#endif
adv_schemes
(
1
)
=
"3D first-order upstream advection"
...
...
src/futils/getm_timers.F90
View file @
442417ac
...
...
@@ -73,6 +73,7 @@
! These catch stuff that are *also* measured somewhere else:
integer
,
parameter
::
TIM_ADVECT3DTOT
=
100
! advection_3d (uv+tracers)
integer
,
parameter
::
TIM_CHECK3DF
=
102
! check_3d_fields
integer
,
parameter
::
TIM_MIXANALYSIS
=
103
! (numerical) mixing analysis
! This is test timers for temporary coding purposes:
! Note: All timers with index 170+ (test_timer_first) are
! considered test timers, so dont implement your timers here
...
...
@@ -196,6 +197,7 @@
timernames
(
TIM_CHECK3DF
)
=
' sum check_3d_fields'
timernames
(
TIM_ADVECT3DTOT
)
=
' sum do_advection_3d'
timernames
(
TIM_INTEGR3D
)
=
'integrate_3d other'
timernames
(
TIM_MIXANALYSIS
)
=
'numerical mixing analysis'
! We only really want to display halo-stuff if we compile for parallel:
#ifdef GETM_PARALLEL
...
...
src/ncdf/init_3d_ncdf.F90
View file @
442417ac
...
...
@@ -388,6 +388,39 @@
#endif
end
if
#ifndef NO_BAROCLINIC
if
(
save_mix_analysis
)
then
fv
=
nummix_missing
mv
=
nummix_missing
vr
(
1
)
=
-100.0
vr
(
2
)
=
100.0
err
=
nf_def_var
(
ncid
,
'nummix3d_S'
,
NF_REAL
,
4
,
f4_dims
,
nm3dS_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
nm3dS_id
,
&
long_name
=
'numerical mixing of salinity'
,
&
units
=
'psu**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'nummix3d_T'
,
NF_REAL
,
4
,
f4_dims
,
nm3dT_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
nm3dT_id
,
&
long_name
=
'numerical mixing of temperature'
,
&
units
=
'degC**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'phymix3d_S'
,
NF_REAL
,
4
,
f4_dims
,
pm3dS_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
pm3dS_id
,
&
long_name
=
'physical mixing of salinity'
,
&
units
=
'psu**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'phymix3d_T'
,
NF_REAL
,
4
,
f4_dims
,
pm3dT_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
pm3dT_id
,
&
long_name
=
'physical mixing of temperature'
,
&
units
=
'degC**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
end
if
#endif
#ifdef SPM
if
(
spm_save
)
then
fv
=
spm_missing
...
...
src/ncdf/init_mean_ncdf.F90
View file @
442417ac
...
...
@@ -176,6 +176,63 @@
long_name
=
'mean temperature'
,
units
=
'degC'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
if
(
save_mix_analysis
)
then
fv
=
nummix_missing
mv
=
nummix_missing
vr
(
1
)
=
-100.0
vr
(
2
)
=
100.0
err
=
nf_def_var
(
ncid
,
'nummix3d_S'
,
NF_REAL
,
4
,
f4_dims
,
nm3dS_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
nm3dS_id
,
&
long_name
=
'mean numerical mixing of salinity'
,
&
units
=
'psu**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'nummix3d_T'
,
NF_REAL
,
4
,
f4_dims
,
nm3dT_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
nm3dT_id
,
&
long_name
=
'mean numerical mixing of temperature'
,
&
units
=
'degC**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'phymix3d_S'
,
NF_REAL
,
4
,
f4_dims
,
pm3dS_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
pm3dS_id
,
&
long_name
=
'mean physical mixing of salinity'
,
&
units
=
'psu**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'phymix3d_T'
,
NF_REAL
,
4
,
f4_dims
,
pm3dT_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
pm3dT_id
,
&
long_name
=
'mean physical mixing of temperature'
,
&
units
=
'degC**2/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'nummix2d_S'
,
NF_REAL
,
3
,
f3_dims
,
nm2dS_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
nm2dS_id
,
&
long_name
=
'mean, vert.integrated numerical mixing of salinity'
,
&
units
=
'psu**2 m/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'nummix2d_T'
,
NF_REAL
,
3
,
f3_dims
,
nm2dT_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
nm2dT_id
,
&
long_name
=
'mean, vert.integrated numerical mixing of temperature'
,
&
units
=
'degC**2 m/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'phymix2d_S'
,
NF_REAL
,
3
,
f3_dims
,
pm2dS_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
pm2dS_id
,
&
long_name
=
'mean, vert.integrated physical mixing of salinity'
,
&
units
=
'psu**2 m/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
err
=
nf_def_var
(
ncid
,
'phymix2d_T'
,
NF_REAL
,
3
,
f3_dims
,
pm2dT_id
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
set_attributes
(
ncid
,
pm2dT_id
,
&
long_name
=
'mean, vert.integrated physical mixing of temperature'
,
&
units
=
'degC**2 m/s'
,&
FillValue
=
fv
,
missing_value
=
mv
,
valid_range
=
vr
)
end
if
! globals
err
=
nf_put_att_text
(
ncid
,
NF_GLOBAL
,
'title'
,
LEN_TRIM
(
title
),
title
)
if
(
err
.NE.
NF_NOERR
)
go to
10
...
...
src/ncdf/ncdf_3d.F90
View file @
442417ac
...
...
@@ -35,6 +35,8 @@
#ifdef GETM_BIO
integer
,
allocatable
::
bio_ids
(:)
#endif
integer
::
nm3dS_id
,
nm3dT_id
,
nm2dS_id
,
nm2dT_id
integer
::
pm3dS_id
,
pm3dT_id
,
pm2dS_id
,
pm2dT_id
REAL_4B
,
dimension
(:),
allocatable
::
ws
...
...
@@ -60,6 +62,7 @@
#ifdef GETM_BIO
REALTYPE
,
parameter
::
bio_missing
=
-9999.0
#endif
REALTYPE
,
parameter
::
nummix_missing
=
-9999.0
!
! !REVISION HISTORY:
...
...
src/ncdf/ncdf_mean.F90
View file @
442417ac
...
...
@@ -32,6 +32,9 @@
REALTYPE
,
parameter
::
temp_missing
=
-9999.0
REALTYPE
,
parameter
::
tke_missing
=
-9999.0
REALTYPE
,
parameter
::
eps_missing
=
-9999.0
REALTYPE
,
parameter
::
nummix_missing
=
-9999.0
integer
::
nm3dS_id
,
nm3dT_id
,
nm2dS_id
,
nm2dT_id
integer
::
pm3dS_id
,
pm3dT_id
,
pm2dS_id
,
pm2dT_id
REAL_4B
,
dimension
(:),
allocatable
::
ws
!
...
...
src/ncdf/save_3d_ncdf.F90
View file @
442417ac
...
...
@@ -27,6 +27,7 @@
use
variables_3d
,
only
:
taubx
,
tauby
#ifndef NO_BAROCLINIC
use
variables_3d
,
only
:
S
,
T
,
rho
,
rad
,
NN
use
variables_3d
,
only
:
nummix3d_S
,
nummix3d_T
,
phymix3d_S
,
phymix3d_T
#endif
use
variables_3d
,
only
:
tke
,
num
,
nuh
,
eps
#ifdef SPM
...
...
@@ -355,6 +356,27 @@
end
if
! save_ss_nn
#ifndef NO_BAROCLINIC
if
(
save_mix_analysis
)
then
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
nummix3d_S
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
nm3dS_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
nummix3d_T
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
nm3dT_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
phymix3d_S
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
pm3dS_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
phymix3d_T
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
pm3dT_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
end
if
! save_mix_analysis
#endif
#ifdef SPM
if
(
spm_save
)
then
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
spm
,
spm_missing
,
&
...
...
src/ncdf/save_mean_ncdf.F90
View file @
442417ac
...
...
@@ -132,6 +132,54 @@
err
=
nf_put_vara_real
(
ncid
,
tempmean_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
if
(
save_mix_analysis
)
then
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
&
nummix3d_S_mean
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
nm3dS_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
&
nummix3d_T_mean
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
nm3dT_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
&
phymix3d_S_mean
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
pm3dS_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_3d
(
imin
,
jmin
,
imax
,
jmax
,
kmin
,
kmax
,
az
,
&
phymix3d_T_mean
,
nummix_missing
,
&
imin
,
imax
,
jmin
,
jmax
,
0
,
kmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
pm3dT_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
start
(
1
)
=
1
start
(
2
)
=
1
start
(
3
)
=
n3d
edges
(
1
)
=
xlen
edges
(
2
)
=
ylen
edges
(
3
)
=
1
call
cnv_2d
(
imin
,
jmin
,
imax
,
jmax
,
az
,
nummix2d_S_mean
,
nummix_missing
,
&
imin
,
jmin
,
imax
,
jmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
nm2dS_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_2d
(
imin
,
jmin
,
imax
,
jmax
,
az
,
nummix2d_T_mean
,
nummix_missing
,
&
imin
,
jmin
,
imax
,
jmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
nm2dT_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_2d
(
imin
,
jmin
,
imax
,
jmax
,
az
,
phymix2d_S_mean
,
nummix_missing
,
&
imin
,
jmin
,
imax
,
jmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
pm2dS_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
call
cnv_2d
(
imin
,
jmin
,
imax
,
jmax
,
az
,
phymix2d_T_mean
,
nummix_missing
,
&
imin
,
jmin
,
imax
,
jmax
,
ws
)
err
=
nf_put_vara_real
(
ncid
,
pm2dT_id
,
start
,
edges
,
ws
)
if
(
err
.NE.
NF_NOERR
)
go to
10
end
if
err
=
nf_sync
(
ncid
)
if
(
err
.NE.
NF_NOERR
)
go to
10
...
...
src/output/calc_mean_fields.F90
View file @
442417ac
...
...
@@ -15,9 +15,12 @@
use
domain
,
only
:
az
,
au
,
av
use
meteo
,
only
:
swr
use
m3d
,
only
:
M
use
variables_3d
,
only
:
do_mixing_analysis
use
variables_3d
,
only
:
hn
,
uu
,
hun
,
vv
,
hvn
,
ww
,
taub
#ifndef NO_BAROCLINIC
use
variables_3d
,
only
:
S
,
T
use
variables_3d
,
only
:
nummix3d_S
,
nummix2d_S
,
nummix3d_T
,
nummix2d_T
use
variables_3d
,
only
:
phymix3d_S
,
phymix2d_S
,
phymix3d_T
,
phymix2d_T
#endif
use
diagnostic_variables
use
getm_timers
,
only
:
tic
,
toc
,
TIM_CALCMEANF
...
...
@@ -98,6 +101,33 @@
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (Smean)'
#endif
if
(
do_mixing_analysis
)
then
allocate
(
nummix3d_S_mean
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix3d_S_mean)'
allocate
(
nummix3d_T_mean
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix3d_T_mean)'
allocate
(
nummix2d_S_mean
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix2d_S_mean)'
allocate
(
nummix2d_T_mean
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix2d_T_mean)'
allocate
(
phymix3d_S_mean
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix3d_S_mean)'
allocate
(
phymix3d_T_mean
(
I3DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix3d_T_mean)'
allocate
(
phymix2d_S_mean
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix2d_S_mean)'
allocate
(
phymix2d_T_mean
(
I2DFIELD
),
stat
=
rc
)
if
(
rc
/
=
0
)
&
stop
'calc_mean_fields.F90: Error allocating memory (nummix2d_T_mean)'
end
if
first
=
.false.
end
if
...
...
@@ -106,6 +136,12 @@
humean
=
_
ZERO_
;
hvmean
=
_
ZERO_
;
hmean
=
_
ZERO_
#ifndef NO_BAROCLINIC
Tmean
=
_
ZERO_
;
Smean
=
_
ZERO_
if
(
do_mixing_analysis
)
then
nummix3d_S_mean
=
_
ZERO_
;
nummix2d_S_mean
=
_
ZERO_
nummix3d_T_mean
=
_
ZERO_
;
nummix2d_T_mean
=
_
ZERO_
phymix3d_S_mean
=
_
ZERO_
;
phymix2d_S_mean
=
_
ZERO_
phymix3d_T_mean
=
_
ZERO_
;
phymix2d_T_mean
=
_
ZERO_
end
if
#endif
ustarmean
=
_
ZERO_
;
ustar2mean
=
_
ZERO_
;
swrmean
=
_
ZERO_
end
if
...
...
@@ -140,8 +176,17 @@
Tmean
=
Tmean
+
T
Smean
=
Smean
+
S
hmean
=
hmean
+
hn
if
(
do_mixing_analysis
)
then
nummix3d_S_mean
=
nummix3d_S_mean
+
nummix3d_S
nummix2d_S_mean
=
nummix2d_S_mean
+
nummix2d_S
nummix3d_T_mean
=
nummix3d_T_mean
+
nummix3d_T
nummix2d_T_mean
=
nummix2d_T_mean
+
nummix2d_T
phymix3d_S_mean
=
phymix3d_S_mean
+
phymix3d_S
phymix2d_S_mean
=
phymix2d_S_mean
+
phymix2d_S
phymix3d_T_mean
=
phymix3d_T_mean
+
phymix3d_T
phymix2d_T_mean
=
phymix2d_T_mean
+
phymix2d_T
end
if
#endif
! count them
step
=
step
+
1.0
end
if
! here we summed them up
...
...
@@ -160,6 +205,16 @@
Tmean
=
Tmean
/
step
Smean
=
Smean
/
step
hmean
=
hmean
/
step
if
(
do_mixing_analysis
)
then
nummix3d_S_mean
=
nummix3d_S_mean
/
step
nummix2d_S_mean
=
nummix2d_S_mean
/
step
nummix3d_T_mean
=
nummix3d_T_mean
/
step
nummix2d_T_mean
=
nummix2d_T_mean
/
step
phymix3d_S_mean
=
phymix3d_S_mean
/
step
phymix2d_S_mean
=
phymix2d_S_mean
/
step
phymix3d_T_mean
=
phymix3d_T_mean
/
step
phymix2d_T_mean
=
phymix2d_T_mean
/
step
end
if
#endif
ustarmean
=
ustarmean
/
step
...
...
src/output/diagnostic_variables.F90
View file @
442417ac
...
...
@@ -28,6 +28,16 @@
REALTYPE
,
dimension
(:,:,:),
allocatable
::
hmean
REALTYPE
,
dimension
(:,:,:),
allocatable
::
Tmean
REALTYPE
,
dimension
(:,:,:),
allocatable
::
Smean
REALTYPE
,
dimension
(:,:,:),
allocatable
::
nummix3d_S_mean
REALTYPE
,
dimension
(:,:),
allocatable
::
nummix2d_S_mean
REALTYPE
,
dimension
(:,:,:),
allocatable
::
nummix3d_T_mean
REALTYPE
,
dimension
(:,:),
allocatable
::
nummix2d_T_mean
REALTYPE
,
dimension
(:,:,:),
allocatable
::
phymix3d_S_mean
REALTYPE
,
dimension
(:,:),
allocatable
::
phymix2d_S_mean
REALTYPE
,
dimension
(:,:,:),
allocatable
::
phymix3d_T_mean
REALTYPE
,
dimension
(:,:),
allocatable
::
phymix2d_T_mean
!
! !REVISION HISTORY: