diff --git a/src/framework/mpas_forcing.F b/src/framework/mpas_forcing.F index 538e6a85c9d7..d02894de7963 100644 --- a/src/framework/mpas_forcing.F +++ b/src/framework/mpas_forcing.F @@ -13,7 +13,6 @@ module mpas_forcing #define COMMA , -#define FORCING_DEBUG_DO(M) !M #define FORCING_DEBUG_WRITE(M) !call mpas_log_write( M ) #define FORCING_WARNING_WRITE(M) call mpas_log_write( M , messageType=MPAS_LOG_WARN) #define FORCING_ERROR_WRITE(M) call mpas_log_write( M , messageType=MPAS_LOG_ERR) @@ -164,9 +163,9 @@ subroutine mpas_forcing_init_group(&!{{{ ! set the forcing end time call MPAS_set_timeInterval(zeroDuration, DD=0) - if (forcingGroupNew % forcingCycleDuration .gt. zeroDuration) then + if (forcingGroupNew % forcingCycleDuration .gt. zeroDuration) then forcingGroupNew % forcingCycleEnd = forcingGroupNew % forcingCycleStart + forcingGroupNew % forcingCycleDuration - else if (forcingGroupNew % forcingCycleDuration .le. zeroDuration) then + else if (forcingGroupNew % forcingCycleDuration .le. zeroDuration) then ! no cycle so set before cycle start call MPAS_set_timeInterval(timeInterval, DD=1000) forcingGroupNew % forcingCycleEnd = forcingGroupNew % forcingCycleStart - timeInterval @@ -193,15 +192,15 @@ end subroutine mpas_forcing_init_group!}}} !> \brief Add a field to the forcing group !> \author Adrian K. Turner, LANL !> \date September 25th 2014 -!> \details +!> \details !> Add a individual forcing field to the forcing group. All the fields !> in a forcing group use the same cycling forcing clock. 'streammanager' !> is the streams manager object that will perform the IO. 'forcingGroupHead' -!> is the forcing group object that the field will be added to and +!> is the forcing group object that the field will be added to and !> 'forcingGroupName' is the name of that forcing group. 'forcingName' is !> an identifying string for the forcing field. 'forcingStreamID' is the !> stream identifier associtiated with the field. In registry, the output -!> field is called 'fieldname' and is in the 'poolname' pool. The interpolation +!> field is called 'fieldname' and is in the 'poolname' pool. The interpolation !> for this field will use the 'interpolationType' interpolation type !> (currently one of 'linear', 'constant' or 'four_point_polynomial'). !> 'forcingReferenceTimeStr' gives a reference time for the forcing data times @@ -209,8 +208,8 @@ end subroutine mpas_forcing_init_group!}}} !> time interval between input data times. If 'forcingIntervalStr' is not !> specified function pointers must be given that calculate a variable !> interval. One is for the interval forward from a given forcing data time -!> ('variable_interval_forward') and the other is for backwards from that -!> time ('variable_interval_backward'). +!> ('variable_interval_forward') and the other is for backwards from that +!> time ('variable_interval_backward'). ! !----------------------------------------------------------------------- @@ -234,7 +233,7 @@ subroutine mpas_forcing_init_field(&!{{{ type(mpas_forcing_group_type), pointer :: & forcingGroupHead !< Input: the forcing group linked list - + character(len=*), intent(in) :: & forcingGroupName, & !< Input: the identifying name of the forcing group forcingName, & !< Input: the identifying name of the individual forcing @@ -256,7 +255,7 @@ function variable_interval_forward(currentTime) result(variableInterval) type(MPAS_TimeInterval_type) :: variableInterval end function variable_interval_forward end interface - + ! backward variable interval function interface function variable_interval_backward(currentTime) result(variableInterval) @@ -288,7 +287,7 @@ end function variable_interval_backward ! only get forcings for correct forcings if (trim(forcingGroup % forcingGroupName) == trim(forcingGroupName)) then - FORCING_DEBUG_WRITE('-- Forcing: mpas_forcing_init_forcing '//trim(trim(forcingGroupName)) COMMA associated(forcingGroup % stream)) + FORCING_DEBUG_WRITE('-- Forcing: mpas_forcing_init_forcing '//trim(trim(forcingGroupName))//" $l" COMMA logicArgs=(/associated(forcingGroup % stream)/)) ! loop through the stream linked list if (.not. associated(forcingGroup % stream)) then @@ -355,7 +354,7 @@ end function variable_interval_backward forcingInitializationType, & variable_interval_forward, & variable_interval_backward) - + call add_forcing_field_to_forcing_stream(& forcingStreamNew, & forcingGroup % domain_ptr, & @@ -411,7 +410,7 @@ subroutine create_new_forcing_stream(&!{{{ type (MPAS_streamManager_type), intent(inout) :: & streamManager ! the stream manager - + character(len=*), intent(in) :: & forcingName, & !< Input: the name of the forcing field forcingStreamID, & !< Input: the stream ID attached to the forcing field @@ -430,7 +429,7 @@ function variable_interval_forward(currentTime) result(variableInterval) type(MPAS_TimeInterval_type) :: variableInterval end function variable_interval_forward end interface - + ! backward variable interval function interface function variable_interval_backward(currentTime) result(variableInterval) @@ -462,11 +461,11 @@ end function variable_interval_backward ! set the forcing stream ID forcingStreamNew % forcingStreamID = trim(forcingStreamID) - + FORCING_DEBUG_WRITE('-- Forcing: create_new_forcing_stream interpolationType: '//trim(interpolationType)) ! interpolation type - forcingStreamNew % interpolationType = trim(interpolationType) + forcingStreamNew % interpolationType = trim(interpolationType) call interpolation_time_stencil_info(& trim(forcingStreamNew % interpolationType), & forcingStreamNew % nTimeStencil, & @@ -547,7 +546,7 @@ end subroutine create_new_forcing_stream!}}} !> \author Adrian K. Turner, LANL !> \date 24th November 2014 !> \details add the details of a new forcing field to the linked list -!> contained within the forcing stream type +!> contained within the forcing stream type ! !----------------------------------------------------------------------- @@ -573,7 +572,7 @@ subroutine add_forcing_field_to_forcing_stream(&!{{{ type (MPAS_streamManager_type), intent(inout) :: & streamManager ! the stream manager - + character(len=*), intent(in) :: & forcingName, & !< Input: the identifying name of the individual forcing poolname, & !< Input: the pool name with the output field @@ -593,7 +592,7 @@ function variable_interval_forward(currentTime) result(variableInterval) type(MPAS_TimeInterval_type) :: variableInterval end function variable_interval_forward end interface - + ! backward variable interval function interface function variable_interval_backward(currentTime) result(variableInterval) @@ -704,8 +703,8 @@ end function variable_interval_backward forcingFieldNew % forcingName = trim(forcingName) ! set the field names - forcingFieldNew % poolname = trim(poolname) - forcingFieldNew % fieldname = trim(fieldname) + forcingFieldNew % poolname = trim(poolname) + forcingFieldNew % fieldname = trim(fieldname) ! set up the input fields call setup_input_fields(& @@ -724,7 +723,7 @@ end subroutine add_forcing_field_to_forcing_stream!}}} !> \author Adrian K. Turner, LANL !> \date September 25th 2014 !> \details -!> Given a forcing time this returns the forcing interval either +!> Given a forcing time this returns the forcing interval either !> forwards or backwards to the next forcing time. ! !----------------------------------------------------------------------- @@ -749,8 +748,6 @@ function forcing_interval(forcingStream, currentTime, forward) result(forcingInt forward_use = .true. if (present(forward)) forward_use = forward - !FORCING_DEBUG_WRITE('-- Forcing: forcing_interval: '//trim(forcingStream % forcingStreamID) COMMA associated(forcingStream % variable_interval_forward_ptr)) - if (.not. associated(forcingStream % variable_interval_forward_ptr)) then ! use constant interval forcingInterval = forcingStream % forcingIntervalConstant @@ -762,7 +759,7 @@ function forcing_interval(forcingStream, currentTime, forward) result(forcingInt forcingInterval = forcingStream % variable_interval_backward_ptr(currentTime) endif end if - + end function forcing_interval!}}} !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| @@ -774,8 +771,8 @@ end function forcing_interval!}}} !> \date September 25th 2014 !> \details !> Given the forcing reference time and interval determine the initial -!> forcing times given the current forcing clock time. This searches -!> for the initial times so reference time is not restricted. +!> forcing times given the current forcing clock time. This searches +!> for the initial times so reference time is not restricted. ! !----------------------------------------------------------------------- @@ -799,19 +796,19 @@ subroutine get_initial_forcing_times(&!{{{ ! set the current forcing time currentTime = mpas_get_clock_time(forcingGroup % forcingClock, MPAS_NOW) - + ! initialize the forcing data time forcingTime1 = forcingStream % forcingReferenceTime forcingTime2 = forcingStream % forcingReferenceTime + forcing_interval(forcingStream, forcingStream % forcingReferenceTime) if (currentTime .ge. forcingTime1 .and. & currentTime .lt. forcingTime2) then - ! current forcing clock time is in the current interval + ! current forcing clock time is in the current interval call populate_forcing_times(forcingStream, forcingTime1, forcingStream % nTimeStencilLower) else if (currentTime .lt. forcingTime1) then - ! current forcing clock time earlier than the current interval + ! current forcing clock time earlier than the current interval backward_search: do @@ -827,7 +824,7 @@ subroutine get_initial_forcing_times(&!{{{ end do backward_search else if (currentTime .ge. forcingTime2) then - ! current forcing clock time later than the current interval + ! current forcing clock time later than the current interval forward_search: do @@ -843,7 +840,7 @@ subroutine get_initial_forcing_times(&!{{{ end do forward_search endif - + end subroutine get_initial_forcing_times!}}} !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| @@ -892,7 +889,7 @@ subroutine populate_forcing_times(&!{{{ forcingStream % forcingTimes(iTime) = forcingTime enddo ! iTime - + ! fill out lower forcingTime = forcingTimeSlot do iTime = forcingSlot-1, 1, -1 @@ -914,7 +911,7 @@ end subroutine populate_forcing_times!}}} !> \details !> Once all the fields have been added to the forcing group object read !> in all the data for all initial forcing times for all the fields in -!> the forcing group. 'forcingGroupHead' is the forcing group object, +!> the forcing group. 'forcingGroupHead' is the forcing group object, !> 'forcingGroupName' is the name of the forcing group to read data into !> and 'streamManager' is the stream manager that will perform the IO. ! @@ -945,7 +942,7 @@ subroutine mpas_forcing_init_field_data(&!{{{ type(mpas_forcing_group_type), pointer :: & forcingGroup ! forcing group iterator - type(mpas_forcing_stream_type), pointer :: & + type(mpas_forcing_stream_type), pointer :: & forcingStream ! forcing stream iterator ! loop over forcings linked list @@ -969,7 +966,7 @@ subroutine mpas_forcing_init_field_data(&!{{{ end do endif - + forcingGroup => forcingGroup % next end do @@ -1015,7 +1012,7 @@ subroutine get_initial_forcing_data(&!{{{ currentForcingTime character(len=strKIND) :: & - forcingTimeStr ! the timestamp of the forcing time + forcingTimeStr ! the timestamp of the forcing time integer :: & iTime, & ! index of the forcing time stops @@ -1026,7 +1023,7 @@ subroutine get_initial_forcing_data(&!{{{ ! loop over the forcing time slots do iTime = 1, forcingStream % nTimeStencil - + ! get the forcing time of the slot forcingTimeCycle = forcingStream % forcingTimes(iTime) @@ -1039,7 +1036,7 @@ subroutine get_initial_forcing_data(&!{{{ ! cycle start time is inclusive to the cycle if (forcingTimeCycle .lt. forcingGroup % forcingCycleStart) then - do + do forcingTimeCycle = forcingTimeCycle + forcingGroup % forcingCycleDuration if (forcingTimeCycle .ge. forcingGroup % forcingCycleStart .and. & forcingTimeCycle .lt. forcingGroup % forcingCycleEnd) exit @@ -1047,7 +1044,7 @@ subroutine get_initial_forcing_data(&!{{{ endif if (forcingTimeCycle .ge. forcingGroup % forcingCycleEnd) then - do + do forcingTimeCycle = forcingTimeCycle - forcingGroup % forcingCycleDuration if (forcingTimeCycle .ge. forcingGroup % forcingCycleStart .and. & forcingTimeCycle .lt. forcingGroup % forcingCycleEnd) exit @@ -1059,7 +1056,7 @@ subroutine get_initial_forcing_data(&!{{{ ! cycle start time is not inclusive to the cycle if (forcingTimeCycle .le. forcingGroup % forcingCycleStart) then - do + do forcingTimeCycle = forcingTimeCycle + forcingGroup % forcingCycleDuration if (forcingTimeCycle .gt. forcingGroup % forcingCycleStart .and. & forcingTimeCycle .le. forcingGroup % forcingCycleEnd) exit @@ -1067,7 +1064,7 @@ subroutine get_initial_forcing_data(&!{{{ endif if (forcingTimeCycle .gt. forcingGroup % forcingCycleEnd) then - do + do forcingTimeCycle = forcingTimeCycle - forcingGroup % forcingCycleDuration if (forcingTimeCycle .gt. forcingGroup % forcingCycleStart .and. & forcingTimeCycle .le. forcingGroup % forcingCycleEnd) exit @@ -1113,7 +1110,7 @@ subroutine get_initial_forcing_data(&!{{{ ! load the data into the slot call mpas_get_time(forcingTimeCycle, dateTimeString=forcingTimeStr) - FORCING_DEBUG_WRITE('-- Forcing: get_initial_forcing_data: READ ATTEMPT: ' COMMA trim(forcingTimeStr)) + FORCING_DEBUG_WRITE('-- Forcing: get_initial_forcing_data: READ ATTEMPT: '//trim(forcingTimeStr)) call MPAS_stream_mgr_read(& streamManager, & forcingStream % forcingStreamID, & @@ -1127,12 +1124,10 @@ subroutine get_initial_forcing_data(&!{{{ call mpas_log_write('Forcing: get_initial_forcing_data: READ: $i', MPAS_LOG_CRIT, intArgs=(/ierr/)) endif - FORCING_DEBUG_WRITE('-- Forcing: get_initial_forcing_data: ' COMMA iTime COMMA trim(forcingStream % forcingStreamID) COMMA " " COMMA trim(forcingTimeStr)) + FORCING_DEBUG_WRITE('-- Forcing: get_initial_forcing_data: $i '//trim(forcingStream % forcingStreamID)//" "//trim(forcingTimeStr) COMMA intArgs=(/iTime/)) enddo ! iTime - FORCING_DEBUG_WRITE('-------------------------------------------') - if (interpolateAtInit .and. .not. restart) then ! interpolate data @@ -1154,11 +1149,11 @@ end subroutine get_initial_forcing_data!}}} !> \brief Get the forcing data and do interpolation for a forcing group !> \author Adrian K. Turner, LANL !> \date September 25th 2014 -!> \details -!> Loop over all the individual forcing fields in the forcing group -!> and get the data and perform the time interpolation. -!> 'forcingGroupHead' is the forcing group object, 'forcingGroupName' -!> is the name of the forcing group to read data into, 'streamManager' +!> \details +!> Loop over all the individual forcing fields in the forcing group +!> and get the data and perform the time interpolation. +!> 'forcingGroupHead' is the forcing group object, 'forcingGroupName' +!> is the name of the forcing group to read data into, 'streamManager' !> is the stream manager that will perform the IO and 'dt' is the current !> time step duration. ! @@ -1208,14 +1203,14 @@ subroutine mpas_forcing_get_forcing(&!{{{ ! loop over individual forcing fields forcingStream => forcingGroup % stream - do while (associated(forcingStream)) + do while (associated(forcingStream)) ! get the individual forcing call get_forcing(& forcingGroup, & forcingStream, & streamManager) - + forcingStream => forcingStream % next enddo @@ -1249,7 +1244,7 @@ end subroutine mpas_forcing_get_forcing!}}} subroutine advance_forcing_clock(&!{{{ forcingGroup, & dt) - + type(mpas_forcing_group_type), pointer :: & forcingGroup ! the forcing group object @@ -1279,7 +1274,7 @@ end subroutine advance_forcing_clock!}}} subroutine cycle_forcing_clock(&!{{{ forcingGroup) - + type(mpas_forcing_group_type), pointer :: & forcingGroup ! the forcing group object @@ -1305,7 +1300,7 @@ subroutine cycle_forcing_clock(&!{{{ ! if ringing cycle the forcing times forcingStream => forcingGroup % stream - do while (associated(forcingStream)) + do while (associated(forcingStream)) ! cycle all the current forcing times do iTime = 1, forcingStream % nTimeStencil @@ -1327,9 +1322,9 @@ end subroutine cycle_forcing_clock!}}} !> \author Adrian K. Turner, LANL !> \date 24th November 2014 !> \details -!> Return the current forcing clock time for a forcing group. -!> 'forcingGroupHead' is the forcing group object, 'forcingGroupName' -!> is the name of the forcing group to get the time for and +!> Return the current forcing clock time for a forcing group. +!> 'forcingGroupHead' is the forcing group object, 'forcingGroupName' +!> is the name of the forcing group to get the time for and !> 'forcingTime' is the output forcing group current clock time. ! !----------------------------------------------------------------------- @@ -1375,7 +1370,7 @@ end subroutine mpas_forcing_get_forcing_time!}}} !> \author Adrian K. Turner, LANL !> \date September 25th 2014 !> \details -!> Get the data for the new forcing time and perform the time +!> Get the data for the new forcing time and perform the time !> interpolation for all the fields in a forcing stream ! !----------------------------------------------------------------------- @@ -1396,7 +1391,7 @@ subroutine get_forcing(&!{{{ type(MPAS_Time_type) :: & currentTime, & ! the current forcing time - forcingTimeNew ! the next forcing time + forcingTimeNew ! the next forcing time character(len=strKIND) :: & forcingTimeCycleStr, & ! the cycled forcing time @@ -1406,7 +1401,7 @@ subroutine get_forcing(&!{{{ iTime, & ! forcing times index ierr ! status of stream read - FORCING_DEBUG_WRITE('-- Forcing: mpas_forcing_get_forcing' COMMA mpas_is_alarm_ringing(forcingGroup % forcingClock, forcingStream % forcingAlarmID)) + FORCING_DEBUG_WRITE('-- Forcing: mpas_forcing_get_forcing: $l' COMMA logicArgs=(/mpas_is_alarm_ringing(forcingGroup % forcingClock, forcingStream % forcingAlarmID)/)) ! get current forcing time currentTime = mpas_get_clock_time(forcingGroup % forcingClock, MPAS_NOW) @@ -1424,16 +1419,16 @@ subroutine get_forcing(&!{{{ do iTime = 1, forcingStream % nTimeStencil-1 forcingStream % forcingTimes(iTime) = forcingStream % forcingTimes(iTime+1) enddo ! iTime - - ! shift data + + ! shift data call forcing_shift_data(& forcingGroup % domain_ptr, & forcingStream) - + ! determine new time to load data from forcingTimeNew = forcingStream % forcingTimes(forcingStream % nTimeStencil-1) + & forcing_interval(forcingStream, forcingStream % forcingTimes(forcingStream % nTimeStencil-1)) - + ! add the new time to the final time slot forcingStream % forcingTimes(forcingStream % nTimeStencil) = forcingTimeNew @@ -1464,9 +1459,6 @@ subroutine get_forcing(&!{{{ endif ! forcingAlarmID ringing - FORCING_DEBUG_DO(call mpas_get_time(currentTime, dateTimeString=forcingTimeStr)) - FORCING_DEBUG_WRITE('-- Forcing: mpas_forcing_get_forcing: FORCING: ' // trim(forcingStream % forcingStreamID) // " " // trim(forcingTimeStr) // " " // trim(forcingTimeStrAll)) - ! interpolate data call forcing_data_interpolation(& forcingGroup % domain_ptr, & @@ -1488,7 +1480,7 @@ end subroutine get_forcing!}}} !> \date September 25th 2014 !> \details !> Given a particular interpolation type return the size of the time -!> stencil and the number of forcing times earlier and later than the +!> stencil and the number of forcing times earlier and later than the !> current forcing time ! !----------------------------------------------------------------------- @@ -1534,7 +1526,7 @@ end subroutine interpolation_time_stencil_info!}}} !> \author Adrian K. Turner, LANL !> \date September 25th 2014 !> \details -!> Given the current time and forcing times calculate the correct +!> Given the current time and forcing times calculate the correct !> interpolants given the interpolation type ! !----------------------------------------------------------------------- @@ -1571,7 +1563,7 @@ end subroutine get_interpolants!}}} !> \author Adrian K. Turner, LANL !> \date September 25th 2014 !> \details -!> Given the current time and forcing times calculate the correct +!> Given the current time and forcing times calculate the correct !> interpolants with linear interpolation ! !----------------------------------------------------------------------- @@ -1618,7 +1610,7 @@ end subroutine get_interpolants_linear!}}} !> \author Adrian K. Turner, LANL !> \date September 25th 2014 !> \details -!> Given the current time and forcing times calculate the correct +!> Given the current time and forcing times calculate the correct !> interpolants with piecewise constant interpolation ! !----------------------------------------------------------------------- @@ -1659,7 +1651,7 @@ end subroutine get_interpolants_constant!}}} !> \author Adrian K. Turner, LANL !> \date September 25th 2014 !> \details -!> Given the forcing times calculate the interpolation weights for +!> Given the forcing times calculate the interpolation weights for !> a four point Lagrange polynomial interpolation ! !----------------------------------------------------------------------- @@ -1686,7 +1678,7 @@ subroutine get_interpolants_four_point_polynomial(interpolants, forcingStream, c x2_interval = forcingStream % forcingTimes(2) - currentTime x3_interval = forcingStream % forcingTimes(3) - currentTime x4_interval = forcingStream % forcingTimes(4) - currentTime - + call mpas_get_timeInterval(x0_interval, currentTime, dt=x0) call mpas_get_timeInterval(x1_interval, currentTime, dt=x1) call mpas_get_timeInterval(x2_interval, currentTime, dt=x2) @@ -1712,7 +1704,7 @@ end subroutine get_interpolants_four_point_polynomial!}}} !> \author Adrian K. Turner, LANL !> \date October 9th, 2014 !> \details -!> This duplicates the output field with the same number of time levels +!> This duplicates the output field with the same number of time levels !> as the time stencil. Data is read into here before interpolation. ! !----------------------------------------------------------------------- @@ -1752,7 +1744,7 @@ subroutine setup_input_fields(&!{{{ type(field3DReal), pointer :: field3DRealInput, field3DRealOutput, field3DRealInputPrev type(field4DReal), pointer :: field4DRealInput, field4DRealOutput, field4DRealInputPrev type(field5DReal), pointer :: field5DRealInput, field5DRealOutput, field5DRealInputPrev - + type(field0DInteger), pointer :: field0DIntInput, field0DIntOutput, field0DIntInputPrev type(field1DInteger), pointer :: field1DIntInput, field1DIntOutput, field1DIntInputPrev type(field2DInteger), pointer :: field2DIntInput, field2DIntOutput, field2DIntInputPrev @@ -1765,7 +1757,7 @@ subroutine setup_input_fields(&!{{{ type(field3DReal), dimension(:), pointer :: field3DRealArray type(field4DReal), dimension(:), pointer :: field4DRealArray type(field5DReal), dimension(:), pointer :: field5DRealArray - + type(field0DInteger), dimension(:), pointer :: field0DIntArray type(field1DInteger), dimension(:), pointer :: field1DIntArray type(field2DInteger), dimension(:), pointer :: field2DIntArray @@ -2119,7 +2111,7 @@ subroutine setup_input_fields(&!{{{ call MPAS_pool_add_field(forcingPoolInput, fieldnameInput, field3DIntArray) call MPAS_pool_add_field(block % allFields, fieldnameInput, field3DIntArray) - !call MPAS_pool_links_pools + !call MPAS_pool_links_pools end select @@ -2197,7 +2189,7 @@ subroutine forcing_data_interpolation(&!{{{ real(kind=RKIND), dimension(:,:,:), pointer :: field3DRealInput, field3DRealOutput real(kind=RKIND), dimension(:,:,:,:), pointer :: field4DRealInput, field4DRealOutput real(kind=RKIND), dimension(:,:,:,:,:), pointer :: field5DRealInput, field5DRealOutput - + integer, pointer :: field0DIntInput, field0DIntOutput integer, dimension(:), pointer :: field1DIntInput, field1DIntOutput integer, dimension(:,:), pointer :: field2DIntInput, field2DIntOutput @@ -2215,7 +2207,7 @@ subroutine forcing_data_interpolation(&!{{{ type(mpas_forcing_field_type), pointer :: & forcingField - + ! get the interpolant weights allocate(interpolants(forcingStream % nTimeStencil)) call get_interpolants(interpolants, forcingStream, currentTime) @@ -2247,11 +2239,9 @@ subroutine forcing_data_interpolation(&!{{{ call MPAS_pool_get_array(forcingPoolOutput, trim(forcingField % fieldname), field0DRealOutput, 1) call MPAS_pool_get_array(forcingPoolInput, trim(fieldnameInput), field0DRealInput, 1) field0DRealOutput = field0DRealInput * interpolants(1) - FORCING_DEBUG_WRITE('-- Forcing: forcing_data_interpolation iTime: ' COMMA 1 COMMA ': ' COMMA field0DRealInput COMMA interpolants(1)) do iTime = 2, forcingStream % nTimeStencil call MPAS_pool_get_array(forcingPoolInput, trim(fieldnameInput), field0DRealInput, iTime) field0DRealOutput = field0DRealOutput + field0DRealInput * interpolants(iTime) - FORCING_DEBUG_WRITE('-- Forcing: forcing_data_interpolation iTime: ' COMMA iTime COMMA ': ' COMMA field0DRealInput COMMA interpolants(iTime)) enddo ! iTime case (1) @@ -2358,7 +2348,7 @@ subroutine forcing_data_interpolation(&!{{{ forcingField => forcingField % next end do - + deallocate(interpolants) end subroutine forcing_data_interpolation!}}} @@ -2402,7 +2392,7 @@ subroutine forcing_shift_data(&!{{{ type(field3DReal), pointer :: field3DRealInput1, field3DRealInput2 type(field4DReal), pointer :: field4DRealInput1, field4DRealInput2 type(field5DReal), pointer :: field5DRealInput1, field5DRealInput2 - + type(field0DInteger), pointer :: field0DIntInput1, field0DIntInput2 type(field1DInteger), pointer :: field1DIntInput1, field1DIntInput2 type(field2DInteger), pointer :: field2DIntInput1, field2DIntInput2 @@ -2428,10 +2418,11 @@ subroutine forcing_shift_data(&!{{{ ! get input names poolnameInput = trim(forcingField % poolname)//"_forcing_input" fieldnameInput = trim(forcingField % fieldname)//"_forcing_input" - + FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data pool: '//trim(poolnameInput)//" field: "//trim(fieldnameInput)) ! No need to loop over blocks since mpas_shift_time_levs does this + block => domain % blocklist call MPAS_pool_get_subpool(block % structs, trim(poolnameInput), forcingPoolInput) @@ -2448,11 +2439,7 @@ subroutine forcing_shift_data(&!{{{ select case (forcingFieldInput % contentsDims) case (0) - FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v1: ' COMMA forcingFieldInput % r0a(1) % scalar) - FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v2: ' COMMA forcingFieldInput % r0a(2) % scalar) call mpas_shift_time_levs(forcingFieldInput % r0a) - FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v1: ' COMMA forcingFieldInput % r0a(1) % scalar) - FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v2: ' COMMA forcingFieldInput % r0a(2) % scalar) case (1) call mpas_shift_time_levs(forcingFieldInput % r1a) case (2) @@ -2690,7 +2677,6 @@ subroutine get_restart_times(&!{{{ ! set the forcing group time call MPAS_set_time(forcingClockTime, dateTimeString=trim(forcingGroupRestartTimes(iForcingGroup)(1:ShortStrKind))) - call mpas_create_clock(forcingGroup % forcingClock, startTime=forcingClockTime, timeStep=timeStep, stopTime=stopTime) endif