This subroutine stores the reference profile at uand v points for the variable whose address is given by u_ptr and v_ptr.
674 character(len=*),
intent(in) :: filename_u
675 character(len=*),
intent(in) :: fieldname_u
676 character(len=*),
intent(in) :: filename_v
677 character(len=*),
intent(in) :: fieldname_v
678 type(time_type),
intent(in) :: Time
679 type(ocean_grid_type),
intent(inout) :: G
680 type(unit_scale_type),
intent(in) :: US
681 type(ALE_sponge_CS),
pointer :: CS
682 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
target,
intent(in) :: u_ptr
683 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
target,
intent(in) :: v_ptr
685 real,
allocatable,
dimension(:,:,:) :: u_val
686 real,
allocatable,
dimension(:,:,:) :: mask_u
687 real,
allocatable,
dimension(:,:,:) :: v_val
688 real,
allocatable,
dimension(:,:,:) :: mask_v
690 real,
allocatable,
dimension(:),
target :: z_in, z_edges_in
691 real :: missing_value
694 integer :: isd, ied, jsd, jed
695 integer :: isdB, iedB, jsdB, jedB
696 integer,
dimension(4) :: fld_sz
697 character(len=256) :: mesg
699 if (.not.
associated(cs))
return
701 isd = g%isd; ied = g%ied; jsd = g%jsd; jed = g%jed
702 isdb = g%isdB; iedb = g%iedB; jsdb = g%jsdB; jedb = g%jedB
706 cs%Ref_val_u%id = init_external_field(filename_u, fieldname_u)
708 fld_sz = get_external_field_size(cs%Ref_val_u%id)
709 cs%Ref_val_u%nz_data = fld_sz(3)
710 cs%Ref_val_u%num_tlevs = fld_sz(4)
711 cs%Ref_val_v%id = init_external_field(filename_v, fieldname_v)
713 fld_sz = get_external_field_size(cs%Ref_val_v%id)
714 cs%Ref_val_v%nz_data = fld_sz(3)
715 cs%Ref_val_v%num_tlevs = fld_sz(4)
716 allocate( u_val(isdb:iedb,jsd:jed, fld_sz(3)) )
717 allocate( mask_u(isdb:iedb,jsd:jed, fld_sz(3)) )
718 allocate( v_val(isd:ied,jsdb:jedb, fld_sz(3)) )
719 allocate( mask_v(isd:ied,jsdb:jedb, fld_sz(3)) )
724 call horiz_interp_and_extrap_tracer(cs%Ref_val_u%id,time, 1.0,g,u_val,mask_u,z_in,z_edges_in,&
725 missing_value,.true.,.false.,.false., m_to_z=us%m_to_Z)
731 call horiz_interp_and_extrap_tracer(cs%Ref_val_v%id,time, 1.0,g,v_val,mask_v,z_in,z_edges_in, &
732 missing_value,.true.,.false.,.false., m_to_z=us%m_to_Z)
734 allocate(cs%Ref_val_u%p(fld_sz(3),cs%num_col_u))
735 cs%Ref_val_u%p(:,:) = 0.0
736 do col=1,cs%num_col_u
738 cs%Ref_val_u%p(k,col) = u_val(cs%col_i_u(col),cs%col_j_u(col),k)
742 allocate(cs%Ref_val_v%p(fld_sz(3),cs%num_col_v))
743 cs%Ref_val_v%p(:,:) = 0.0
744 do col=1,cs%num_col_v
746 cs%Ref_val_v%p(k,col) = v_val(cs%col_i_v(col),cs%col_j_v(col),k)