Skip to content
Snippets Groups Projects
Commit 017efff9 authored by Sebastien Masson's avatar Sebastien Masson
Browse files

Merge branch '13-debug_2022_closea' into 'main'

Resolve "debug_2022_closea"

Closes #13

See merge request nemo/core!22
parents 16324fa9 465ac38c
No related branches found
No related tags found
No related merge requests found
...@@ -38,11 +38,11 @@ MODULE sbcclo ...@@ -38,11 +38,11 @@ MODULE sbcclo
PUBLIC sbc_clo PUBLIC sbc_clo
PUBLIC sbc_clo_init PUBLIC sbc_clo_init
! !
REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:) :: rsurfsrcg, rsurftrgg !: closed sea source/target glo surface areas REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:) :: rsurfsrcg, rsurftrgg !: closed sea source/target glo surface areas
REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:) :: rsurfsrcr, rsurftrgr !: closed sea source/target rnf surface areas REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:) :: rsurfsrcr, rsurftrgr !: closed sea source/target rnf surface areas
REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:) :: rsurfsrce, rsurftrge !: closed sea source/target emp surface areas REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:) :: rsurfsrce, rsurftrge !: closed sea source/target emp surface areas
! !
INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:) :: mcsgrpg, mcsgrpr, mcsgrpe !: closed sea group for glo, rnf and emp INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: mcsgrpg, mcsgrpr, mcsgrpe !: closed sea group for glo, rnf and emp
! !
CONTAINS CONTAINS
! !
...@@ -301,19 +301,21 @@ MODULE sbcclo ...@@ -301,19 +301,21 @@ MODULE sbcclo
imsk_trg = kmsk_grp * kmsk_opnsea imsk_trg = kmsk_grp * kmsk_opnsea
END IF END IF
! !
!! 3. Subtract residuals from source points IF( zsurftrg > 0._wp ) THEN ! target area /=0
zcsfwf = zcsfw / zsurfsrc !! 3. Subtract residuals from source points
pwcs(:,:) = pwcs(:,:) - zcsfwf * imsk_src(:,:) zcsfwf = zcsfw / zsurfsrc
pqcs(:,:) = pqcs(:,:) + rcp * zcsfwf * sst_m(:,:) * imsk_src(:,:) pwcs(:,:) = pwcs(:,:) - zcsfwf * imsk_src(:,:)
! pqcs(:,:) = pqcs(:,:) + rcp * zcsfwf * sst_m(:,:) * imsk_src(:,:)
!! 4. Add residuals to target points !
!! Do not use pqcs(:,:) = pqcs(:,:) - rcp * zcsfw * sst_m(:,:) / zsurftrg !! 4. Add residuals to target points
!! as there is no reason heat will be conserved with this formulation !! Do not use pqcs(:,:) = pqcs(:,:) - rcp * zcsfw * sst_m(:,:) / zsurftrg
zcsh = glob_sum( 'closea', e1e2t(:,:) * rcp * zcsfwf * sst_m(:,:) * imsk_src(:,:) ) !! as there is no reason heat will be conserved with this formulation
WHERE( imsk_trg(:,:) == kcsgrp(jcs) ) zcsh = glob_sum( 'closea', e1e2t(:,:) * rcp * zcsfwf * sst_m(:,:) * imsk_src(:,:) )
pwcs(:,:) = pwcs(:,:) + zcsfw / zsurftrg WHERE( imsk_trg(:,:) == kcsgrp(jcs) )
pqcs(:,:) = pqcs(:,:) - zcsh / zsurftrg pwcs(:,:) = pwcs(:,:) + zcsfw / zsurftrg
ENDWHERE pqcs(:,:) = pqcs(:,:) - zcsh / zsurftrg
ENDWHERE
ENDIF
! !
END DO ! jcs END DO ! jcs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment