Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ocean-mixing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
inmcm-mirror
ocean-mixing
Commits
07a0d47c
Commit
07a0d47c
authored
7 months ago
by
Evgeny Mortikov
Browse files
Options
Downloads
Patches
Plain Diff
grid implementation update
parent
ab23d4a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
obl_grid.f90
+19
-1
19 additions, 1 deletion
obl_grid.f90
obl_state_eq.f90
+6
-6
6 additions, 6 deletions
obl_state_eq.f90
with
25 additions
and
7 deletions
obl_grid.f90
+
19
−
1
View file @
07a0d47c
...
...
@@ -26,6 +26,9 @@ module obl_grid
real
,
allocatable
::
dzp
(:)
!< = dz(k) + dz(k + 1) [m]
real
,
allocatable
::
dzm
(:)
!< = dz(k) + dz(k - 1) [m]
real
,
allocatable
::
dzph
(:)
!< = 0.5 * (dz(k) + dz(k + 1)) [m]
real
,
allocatable
::
dzmh
(:)
!< = 0.5 * (dz(k) + dz(k - 1)) [m]
end
type
...
...
@@ -87,7 +90,9 @@ module obl_grid
close
(
io
)
if
(
nedge
>
0
)
then
allocate
(
edge
(
nedge
))
endif
! --- read input data
open
(
newunit
=
io
,
file
=
filename
,
iostat
=
status
,
status
=
'old'
)
...
...
@@ -130,12 +135,17 @@ module obl_grid
grid
%
cz
=
cz
if
(
grid
%
cz
==
0
)
return
allocate
(
grid
%
z
(
grid
%
cz
))
allocate
(
grid
%
dz
(
grid
%
cz
))
allocate
(
grid
%
dzp
(
grid
%
cz
))
allocate
(
grid
%
dzm
(
grid
%
cz
))
allocate
(
grid
%
dzph
(
grid
%
cz
))
allocate
(
grid
%
dzmh
(
grid
%
cz
))
do
k
=
1
,
grid
%
cz
grid
%
z
(
k
)
=
0.5
*
(
edge
(
k
)
+
edge
(
k
+
1
))
grid
%
dz
(
k
)
=
edge
(
k
+
1
)
-
edge
(
k
)
...
...
@@ -151,6 +161,11 @@ module obl_grid
grid
%
dzm
(
k
)
=
grid
%
dz
(
k
)
+
grid
%
dz
(
k
-
1
)
end
do
do
k
=
1
,
grid
%
cz
grid
%
dzph
(
k
)
=
0.5
*
grid
%
dzp
(
k
)
grid
%
dzmh
(
k
)
=
0.5
*
grid
%
dzm
(
k
)
end
do
end
subroutine
set_generic_grid
subroutine
deallocate_grid
(
grid
)
...
...
@@ -165,6 +180,9 @@ module obl_grid
deallocate
(
grid
%
dzp
)
deallocate
(
grid
%
dzm
)
deallocate
(
grid
%
dzph
)
deallocate
(
grid
%
dzmh
)
end
if
grid
%
cz
=
0
...
...
This diff is collapsed.
Click to expand it.
obl_state_eq.f90
+
6
−
6
View file @
07a0d47c
...
...
@@ -36,9 +36,9 @@ module obl_state_eq
! --------------------------------------------------------------------------------
integer
,
intent
(
in
)
::
cz
!< grid size
real
,
intent
(
out
)
::
Rho
(
cz
)
!< density, [kg / m**3]
real
,
intent
(
in
)
::
Theta_dev
(
cz
)
!< temperature, [K]
real
,
intent
(
in
)
::
Salin_dev
(
cz
)
!< salinity, [PSU]
real
,
dimension
(
cz
),
intent
(
out
)
::
Rho
!< density, [kg / m**3]
real
,
dimension
(
cz
),
intent
(
in
)
::
Theta_dev
!< temperature, [K]
real
,
dimension
(
cz
),
intent
(
in
)
::
Salin_dev
!< salinity, [PSU]
integer
::
k
! --------------------------------------------------------------------------------
...
...
@@ -55,9 +55,9 @@ module obl_state_eq
! --------------------------------------------------------------------------------
integer
,
intent
(
in
)
::
cz
!< grid size
real
,
intent
(
out
)
::
Rho_dev
(
cz
)
!< density, [kg / m**3]
real
,
intent
(
in
)
::
Theta_dev
(
cz
)
!< temperature, [K]
real
,
intent
(
in
)
::
Salin_dev
(
cz
)
!< salinity, [PSU]
real
,
dimension
(
cz
),
intent
(
out
)
::
Rho_dev
!< density, [kg / m**3]
real
,
dimension
(
cz
),
intent
(
in
)
::
Theta_dev
!< temperature, [K]
real
,
dimension
(
cz
),
intent
(
in
)
::
Salin_dev
!< salinity, [PSU]
integer
::
k
! --------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment