#571 closed request (Done)
set_data.F and friends
| Reported by: | arango | Owned by: | arango |
|---|---|---|---|
| Priority: | major | Milestone: | Release ROMS/TOMS 3.6 |
| Component: | Nonlinear | Version: | 3.6 |
| Keywords: | Cc: |
Description (last modified by )
Added an additional and optional argument SetBC to set_2dfld.F, set_2dfldr.F, set_3dfld.F, and set_3dfldr.F to control the setting of periodic boundary conditions to a particular interpolated field. For example, in set_2dfld.F we now have:
SUBROUTINE set_2dfld_tile (ng, tile, model, ifield, &
& LBi, UBi, LBj, UBj, &
& Finp, Fout, update, &
& SetBC)
...
logical, intent(in), optional :: SetBC
...
!
! Set switch to apply boundary conditions.
!
IF (PRESENT(SetBC)) THEN
LapplyBC=SetBC
ELSE
LapplyBC=.TRUE.
END IF
...
!
! Exchange boundary data.
!
IF (update) THEN
IF (LapplyBC.and.(EWperiodic(ng).or.NSperiodic(ng))) THEN
IF (gtype.eq.r2dvar) THEN
CALL exchange_r2d_tile (ng, tile, &
& LBi, UBi, LBj, UBj, &
& Fout)
ELSE IF (gtype.eq.u2dvar) THEN
CALL exchange_u2d_tile (ng, tile, &
& LBi, UBi, LBj, UBj, &
& Fout)
ELSE IF (gtype.eq.v2dvar) THEN
CALL exchange_v2d_tile (ng, tile, &
& LBi, UBi, LBj, UBj, &
& Fout)
END IF
END IF
#ifdef DISTRIBUTE
IF (.not.LapplyBC) THEN
CALL mp_exchange2d (ng, tile, model, 1, &
& LBi, UBi, LBj, UBj, &
& NghostPoints, &
& .FALSE., .FALSE., &
& Fout)
ELSE
CALL mp_exchange2d (ng, tile, model, 1, &
& LBi, UBi, LBj, UBj, &
& NghostPoints, &
& EWperiodic(ng), NSperiodic(ng), &
& Fout)
END IF
#endif
END IF
This will facilitate configuring toy problems that require a non-periodic forcing field, say surface air pressure (Pair). Then, in set_data.F we now have:
# if defined BULK_FLUXES || defined ECOSIM || defined ATM_PRESS
!
!-----------------------------------------------------------------------
! Set surface air pressure (mb).
!-----------------------------------------------------------------------
!
# ifdef ANA_PAIR
CALL ana_pair (ng, tile, iNLM)
# else
SetBC=.TRUE.
! SetBC=.FALSE.
CALL set_2dfld_tile (ng, tile, iNLM, idPair, &
& LBi, UBi, LBj, UBj, &
& FORCES(ng)%PairG, &
& FORCES(ng)%Pair, &
& update, SetBC)
IF (exit_flag.ne.NoError) RETURN
# endif
# endif
The default is set to always apply periodic boundary conditions (SetBC=.TRUE.). The user may edit set_data.F or Build/set_data.f90 to avoid applying periodic boundary conditions (SetBC=.FALSE.).
Many thanks to John Wilkin for requesting this useful capability.
Change History (2)
comment:1 by , 13 years ago
| Resolution: | → Done |
|---|---|
| Status: | new → closed |
comment:2 by , 13 years ago
| Description: | modified (diff) |
|---|
