Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
IPSL
LMD
InTro
RoutingPP
Commits
bbf74fde
Commit
bbf74fde
authored
Jan 13, 2021
by
Anthony
Browse files
Fortran Calculation of Mask.
parent
2d794693
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
F90subroutines/diagst.f90
F90subroutines/diagst.f90
+55
-0
No files found.
F90subroutines/diagst.f90
0 → 100644
View file @
bbf74fde
MODULE
diagst
CONTAINS
SUBROUTINE
upstmask
(
nbpt
,
nbasmax
,
routetogrid
,
routetobasin
,&
&
routenbbasin
,
basin_area
,
area
,
g0
,
b0
,
mask
)
IMPLICIT
NONE
!! INPUT
INTEGER
(
4
),
INTENT
(
in
)
::
nbpt
,
nbasmax
!
INTEGER
(
4
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
in
)
::
routetogrid
INTEGER
(
4
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
in
)
::
routetobasin
INTEGER
(
4
),
DIMENSION
(
nbpt
),
INTENT
(
in
)
::
routenbbasin
!
REAL
(
8
),
DIMENSION
(
nbpt
,
nbasmax
),
INTENT
(
in
)
::
basin_area
REAL
(
8
),
DIMENSION
(
nbpt
),
INTENT
(
in
)
::
area
!
INTEGER
(
4
),
INTENT
(
in
)
::
g0
,
b0
!
!! LOCAL
INTEGER
(
4
)
::
ig
,
ib
,
jg
,
jb
,
jt
,
nbas
!
!! OUTPUT
REAL
(
8
),
DIMENSION
(
nbpt
),
INTENT
(
out
)
::
mask
!!
!!
mask
(:)
=
0
DO
ig
=
1
,
nbpt
!WRITE(*,*) ig, "/",nbpt
nbas
=
routenbbasin
(
ig
)
DO
ib
=
1
,
nbas
jg
=
ig
jb
=
ib
DO
WHILE
(
jb
.LE.
nbasmax
)
! CHECK if mask > 0
! valable si j'utilise mask ig,ib
IF
(((
jg
.EQ.
g0
)
.AND.
(
jb
.EQ.
b0
)))
THEN
! add area as a variable
mask
(
ig
)
=
mask
(
ig
)
+
basin_area
(
ig
,
ib
)/
area
(
ig
)
jb
=
nbasmax
+1
ELSE
jt
=
routetogrid
(
jg
,
jb
)
jb
=
routetobasin
(
jg
,
jb
)
jg
=
jt
END
IF
END
DO
END
DO
END
DO
END
SUBROUTINE
upstmask
END
MODULE
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment