Skip to content

Commit

Permalink
fixed a few variable declaration errors in geochem and organic_matter
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Boon committed Oct 27, 2021
1 parent 9689ebb commit fdee0c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/aed_core.F90
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ FUNCTION aed_locate_variable(name) RESULT(ret)
!
!-------------------------------------------------------------------------------
!BEGIN
IF ( TRIM(name) == '' ) THEN ; ret = 0; RETURN ; ENDIF

ret = aed_create_variable(name, '', '', .true.)

IF ( ret /= 0 ) THEN
Expand All @@ -693,6 +695,8 @@ FUNCTION aed_locate_sheet_variable(name) RESULT(ret)
!
!-------------------------------------------------------------------------------
!BEGIN
IF ( TRIM(name) == '' ) THEN ; ret = 0; RETURN ; ENDIF

ret = aed_create_variable(name, '', '', .true.)

IF ( ret /= 0 ) THEN
Expand All @@ -718,6 +722,8 @@ FUNCTION aed_locate_global(name) RESULT(ret)
!
!-------------------------------------------------------------------------------
!BEGIN
IF ( TRIM(name) == '' ) THEN ; ret = 0; RETURN ; ENDIF

IF ( TRIM(name) == "cell_vel" ) THEN
ret = -1
IF ( .NOT. host_has_cell_vel ) RETURN
Expand All @@ -740,6 +746,8 @@ FUNCTION aed_locate_sheet_global(name) RESULT(ret)
!
!-------------------------------------------------------------------------------
!BEGIN
IF ( TRIM(name) == '' ) THEN ; ret = 0; RETURN ; ENDIF

ret = aed_create_variable(name, '', '', .true.)

all_vars(ret)%sheet = .true.
Expand Down
6 changes: 3 additions & 3 deletions src/aed_geochemistry.F90
Original file line number Diff line number Diff line change
Expand Up @@ -313,18 +313,18 @@ SUBROUTINE aed_define_geochemistry(data, namlst)
!----------------------------------------------------------------------------
! Register links to other modules

data%id_o_oxy = aed_locate_global(oxy_link)
data%id_o_oxy = aed_locate_variable(oxy_link)

IF ( ph_link .EQ. '' ) THEN
! Register as a diagnostic variable
data%id_pH = aed_define_diag_variable( 'pH', 'pH', 'pH')
ELSE
! Link to module
data%id_pH = aed_locate_global(ph_link)
data%id_pH = aed_locate_variable(ph_link)
ENDIF

! solution to get aed_carbon's pCO2 updated for atm exchange ...
data%id_c_pco2 = aed_locate_global(pco2_link)
data%id_c_pco2 = aed_locate_variable(pco2_link)

!----------------------------------------------------------------------------
! Register diagnostic variables
Expand Down
1 change: 1 addition & 0 deletions src/aed_organic_matter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ SUBROUTINE aed_define_organic_matter(data, namlst)
ELSE
data%id_Psed_pon = aed_define_diag_variable('Psed_pon','mmol/m**2/s', 'PON sedimentation')
ENDIF
data%use_Psed_link_pop = Psed_pop_variable .NE. ''
IF (data%use_Psed_link_pop) THEN
data%id_Psed_pop = aed_locate_sheet_variable(Psed_pop_variable)
ELSE
Expand Down

0 comments on commit fdee0c1

Please sign in to comment.