@@ -352,24 +352,24 @@ module MOM_open_boundary
352
352
type (remapping_CS), pointer :: remap_h_CS= > NULL () ! < ALE remapping control structure for
353
353
! ! thickness-based fields on segments
354
354
type (OBC_registry_type), pointer :: OBC_Reg = > NULL () ! < Registry type for boundaries
355
- real , allocatable :: rx_normal(:,:,:) ! < Array storage for normal phase speed for EW radiation OBCs in units of
355
+ real , pointer :: rx_normal(:,:,:) ! < Array storage for normal phase speed for EW radiation OBCs in units of
356
356
! ! grid points per timestep [nondim]
357
- real , allocatable :: ry_normal(:,:,:) ! < Array storage for normal phase speed for NS radiation OBCs in units of
357
+ real , pointer :: ry_normal(:,:,:) ! < Array storage for normal phase speed for NS radiation OBCs in units of
358
358
! ! grid points per timestep [nondim]
359
- real , allocatable :: rx_oblique_u(:,:,:) ! < X-direction oblique boundary condition radiation speeds squared
359
+ real , pointer :: rx_oblique_u(:,:,:) ! < X-direction oblique boundary condition radiation speeds squared
360
360
! ! at u points for restarts [L2 T-2 ~> m2 s-2]
361
- real , allocatable :: ry_oblique_u(:,:,:) ! < Y-direction oblique boundary condition radiation speeds squared
361
+ real , pointer :: ry_oblique_u(:,:,:) ! < Y-direction oblique boundary condition radiation speeds squared
362
362
! ! at u points for restarts [L2 T-2 ~> m2 s-2]
363
- real , allocatable :: rx_oblique_v(:,:,:) ! < X-direction oblique boundary condition radiation speeds squared
363
+ real , pointer :: rx_oblique_v(:,:,:) ! < X-direction oblique boundary condition radiation speeds squared
364
364
! ! at v points for restarts [L2 T-2 ~> m2 s-2]
365
- real , allocatable :: ry_oblique_v(:,:,:) ! < Y-direction oblique boundary condition radiation speeds squared
365
+ real , pointer :: ry_oblique_v(:,:,:) ! < Y-direction oblique boundary condition radiation speeds squared
366
366
! ! at v points for restarts [L2 T-2 ~> m2 s-2]
367
- real , allocatable :: cff_normal_u(:,:,:) ! < Denominator for normalizing EW oblique boundary condition radiation
367
+ real , pointer :: cff_normal_u(:,:,:) ! < Denominator for normalizing EW oblique boundary condition radiation
368
368
! ! rates at u points for restarts [L2 T-2 ~> m2 s-2]
369
- real , allocatable :: cff_normal_v(:,:,:) ! < Denominator for normalizing NS oblique boundary condition radiation
369
+ real , pointer :: cff_normal_v(:,:,:) ! < Denominator for normalizing NS oblique boundary condition radiation
370
370
! ! rates at v points for restarts [L2 T-2 ~> m2 s-2]
371
- real , allocatable :: tres_x(:,:,:,:) ! < Array storage of tracer reservoirs for restarts, in unscaled units [conc]
372
- real , allocatable :: tres_y(:,:,:,:) ! < Array storage of tracer reservoirs for restarts, in unscaled units [conc]
371
+ real , pointer :: tres_x(:,:,:,:) ! < Array storage of tracer reservoirs for restarts, in unscaled units [conc]
372
+ real , pointer :: tres_y(:,:,:,:) ! < Array storage of tracer reservoirs for restarts, in unscaled units [conc]
373
373
logical :: debug ! < If true, write verbose checksums for debugging purposes.
374
374
real :: silly_h ! < A silly value of thickness outside of the domain that can be used to test
375
375
! ! the independence of the OBCs to this external data [Z ~> m].
@@ -1948,15 +1948,15 @@ subroutine open_boundary_init(G, GV, US, param_file, OBC, restart_CS)
1948
1948
call create_group_pass(OBC% pass_oblique, OBC% cff_normal_u, OBC% cff_normal_v, G% Domain, To_All+ Scalar_Pair)
1949
1949
call do_group_pass(OBC% pass_oblique, G% Domain)
1950
1950
endif
1951
- if (allocated (OBC% tres_x) .and. allocated (OBC% tres_y)) then
1951
+ if (associated (OBC% tres_x) .and. associated (OBC% tres_y)) then
1952
1952
do m= 1 ,OBC% ntr
1953
1953
call pass_vector(OBC% tres_x(:,:,:,m), OBC% tres_y(:,:,:,m), G% Domain, To_All+ Scalar_Pair)
1954
1954
enddo
1955
- elseif (allocated (OBC% tres_x)) then
1955
+ elseif (associated (OBC% tres_x)) then
1956
1956
do m= 1 ,OBC% ntr
1957
1957
call pass_var(OBC% tres_x(:,:,:,m), G% Domain, position= EAST_FACE)
1958
1958
enddo
1959
- elseif (allocated (OBC% tres_y)) then
1959
+ elseif (associated (OBC% tres_y)) then
1960
1960
do m= 1 ,OBC% ntr
1961
1961
call pass_var(OBC% tres_y(:,:,:,m), G% Domain, position= NORTH_FACE)
1962
1962
enddo
@@ -2001,16 +2001,16 @@ subroutine open_boundary_dealloc(OBC)
2001
2001
if (allocated (OBC% segment)) deallocate (OBC% segment)
2002
2002
if (allocated (OBC% segnum_u)) deallocate (OBC% segnum_u)
2003
2003
if (allocated (OBC% segnum_v)) deallocate (OBC% segnum_v)
2004
- if (allocated (OBC% rx_normal)) deallocate (OBC% rx_normal)
2005
- if (allocated (OBC% ry_normal)) deallocate (OBC% ry_normal)
2006
- if (allocated (OBC% rx_oblique_u)) deallocate (OBC% rx_oblique_u)
2007
- if (allocated (OBC% ry_oblique_u)) deallocate (OBC% ry_oblique_u)
2008
- if (allocated (OBC% rx_oblique_v)) deallocate (OBC% rx_oblique_v)
2009
- if (allocated (OBC% ry_oblique_v)) deallocate (OBC% ry_oblique_v)
2010
- if (allocated (OBC% cff_normal_u)) deallocate (OBC% cff_normal_u)
2011
- if (allocated (OBC% cff_normal_v)) deallocate (OBC% cff_normal_v)
2012
- if (allocated (OBC% tres_x)) deallocate (OBC% tres_x)
2013
- if (allocated (OBC% tres_y)) deallocate (OBC% tres_y)
2004
+ if (associated (OBC% rx_normal)) nullify (OBC% rx_normal)
2005
+ if (associated (OBC% ry_normal)) nullify (OBC% ry_normal)
2006
+ if (associated (OBC% rx_oblique_u)) nullify (OBC% rx_oblique_u)
2007
+ if (associated (OBC% ry_oblique_u)) nullify (OBC% ry_oblique_u)
2008
+ if (associated (OBC% rx_oblique_v)) nullify (OBC% rx_oblique_v)
2009
+ if (associated (OBC% ry_oblique_v)) nullify (OBC% ry_oblique_v)
2010
+ if (associated (OBC% cff_normal_u)) nullify (OBC% cff_normal_u)
2011
+ if (associated (OBC% cff_normal_v)) nullify (OBC% cff_normal_v)
2012
+ if (associated (OBC% tres_x)) nullify (OBC% tres_x)
2013
+ if (associated (OBC% tres_y)) nullify (OBC% tres_y)
2014
2014
if (associated (OBC% remap_z_CS)) deallocate (OBC% remap_z_CS)
2015
2015
if (associated (OBC% remap_h_CS)) deallocate (OBC% remap_h_CS)
2016
2016
deallocate (OBC)
@@ -3369,7 +3369,7 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, G, GV, US,
3369
3369
haloshift= 0 , symmetric= sym, unscale= 1.0 / US% L_T_to_m_s** 2 )
3370
3370
endif
3371
3371
if (OBC% ntr == 0 ) return
3372
- if (.not. allocated (OBC% tres_x) .or. .not. allocated (OBC% tres_y)) return
3372
+ if (.not. associated (OBC% tres_x) .or. .not. associated (OBC% tres_y)) return
3373
3373
do m= 1 ,OBC% ntr
3374
3374
write (var_num,' (I3.3)' ) m
3375
3375
call uvchksum(" radiation_OBCs: OBC%tres_[xy]_" // var_num, OBC% tres_x(:,:,:,m), OBC% tres_y(:,:,:,m), G% HI, &
@@ -5489,7 +5489,7 @@ subroutine update_segment_tracer_reservoirs(G, GV, uhr, vhr, h, OBC, dt, Reg)
5489
5489
((1.0 - a_out+ a_in)* segment% tr_Reg% Tr(m)% tres(I,j,k)+ &
5490
5490
((u_L_out+ a_out)* Reg% Tr(ntr_id)% t(I+ ishift,j,k) - &
5491
5491
(u_L_in+ a_in)* segment% tr_Reg% Tr(m)% t(I,j,k)))
5492
- if (allocated (OBC% tres_x)) OBC% tres_x(I,j,k,m) = I_scale * segment% tr_Reg% Tr(m)% tres(I,j,k)
5492
+ if (associated (OBC% tres_x)) OBC% tres_x(I,j,k,m) = I_scale * segment% tr_Reg% Tr(m)% tres(I,j,k)
5493
5493
enddo ; endif
5494
5494
enddo
5495
5495
enddo
@@ -5529,7 +5529,7 @@ subroutine update_segment_tracer_reservoirs(G, GV, uhr, vhr, h, OBC, dt, Reg)
5529
5529
((1.0 - a_out+ a_in)* segment% tr_Reg% Tr(m)% tres(i,J,k) + &
5530
5530
((v_L_out+ a_out)* Reg% Tr(ntr_id)% t(i,J+ jshift,k) - &
5531
5531
(v_L_in+ a_in)* segment% tr_Reg% Tr(m)% t(i,J,k)))
5532
- if (allocated (OBC% tres_y)) OBC% tres_y(i,J,k,m) = I_scale * segment% tr_Reg% Tr(m)% tres(i,J,k)
5532
+ if (associated (OBC% tres_y)) OBC% tres_y(i,J,k,m) = I_scale * segment% tr_Reg% Tr(m)% tres(i,J,k)
5533
5533
enddo ; endif
5534
5534
enddo
5535
5535
enddo
@@ -5605,7 +5605,7 @@ subroutine remap_OBC_fields(G, GV, h_old, h_new, OBC, PCM_cell)
5605
5605
5606
5606
! Update tracer concentrations
5607
5607
segment% tr_Reg% Tr(m)% tres(I,j,:) = tr_column(:)
5608
- if (allocated (OBC% tres_x)) then ; do k= 1 ,nz
5608
+ if (associated (OBC% tres_x)) then ; do k= 1 ,nz
5609
5609
OBC% tres_x(I,j,k,m) = I_scale * segment% tr_Reg% Tr(m)% tres(I,j,k)
5610
5610
enddo ; endif
5611
5611
@@ -5672,7 +5672,7 @@ subroutine remap_OBC_fields(G, GV, h_old, h_new, OBC, PCM_cell)
5672
5672
5673
5673
! Update tracer concentrations
5674
5674
segment% tr_Reg% Tr(m)% tres(i,J,:) = tr_column(:)
5675
- if (allocated (OBC% tres_y)) then ; do k= 1 ,nz
5675
+ if (associated (OBC% tres_y)) then ; do k= 1 ,nz
5676
5676
OBC% tres_y(i,J,k,m) = I_scale * segment% tr_Reg% Tr(m)% tres(i,J,k)
5677
5677
enddo ; endif
5678
5678
0 commit comments