Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwangwei committed Jan 25, 2024
1 parent d235022 commit 5164992
Show file tree
Hide file tree
Showing 31 changed files with 1,482 additions and 1,487 deletions.
106 changes: 53 additions & 53 deletions CaMa/src/ICI/MAIN_cmf_ici.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,72 @@ PROGRAM MAIN_cmf_ici
! distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and limitations under the License.
!==========================================================
USE PARKIND1, only: JPRB, JPRM, JPIM
USE YOS_CMF_INPUT, only: NXIN, NYIN, DT, DTIN
USE YOS_CMF_TIME, only: NSTEPS
!
USE CMF_DRV_CONTROL_MOD, only: CMF_DRV_INPUT, CMF_DRV_INIT, CMF_DRV_END
USE CMF_DRV_ADVANCE_MOD, only: CMF_DRV_ADVANCE
!USE CMF_CTRL_FORCING_MOD, only: CMF_FORCING_GET, CMF_FORCING_PUT
!
USE CMF_CTRL_ICI_MOD, only: CMF_ICI_INPUT, CMF_ICI_INIT, CMF_ICI_END
USE CMF_CTRL_ICI_MOD, only: CMF_ICI_FORCING_GET,CMF_ICI_OUTPUT
USE palmtime, only: palm_TimeStart, palm_TimeEnd
!$ USE OMP_LIB
IMPLICIT NONE
! Local variables
integer(KIND=JPIM) :: ISTEP ! total time step
integer(KIND=JPIM) :: ISTEPADV ! time step to be advanced within DRV_ADVANCE
real(KIND=JPRB),ALLOCATABLE :: ZBUFF(:,:,:) ! Buffer to store forcing runoff
USE PARKIND1, only: JPRB, JPRM, JPIM
USE YOS_CMF_INPUT, only: NXIN, NYIN, DT, DTIN
USE YOS_CMF_TIME, only: NSTEPS
!
USE CMF_DRV_CONTROL_MOD, only: CMF_DRV_INPUT, CMF_DRV_INIT, CMF_DRV_END
USE CMF_DRV_ADVANCE_MOD, only: CMF_DRV_ADVANCE
!USE CMF_CTRL_FORCING_MOD, only: CMF_FORCING_GET, CMF_FORCING_PUT
!
USE CMF_CTRL_ICI_MOD, only: CMF_ICI_INPUT, CMF_ICI_INIT, CMF_ICI_END
USE CMF_CTRL_ICI_MOD, only: CMF_ICI_FORCING_GET,CMF_ICI_OUTPUT
USE palmtime, only: palm_TimeStart, palm_TimeEnd
!$ USE OMP_LIB
IMPLICIT NONE
! Local variables
integer(KIND=JPIM) :: ISTEP ! total time step
integer(KIND=JPIM) :: ISTEPADV ! time step to be advanced within DRV_ADVANCE
real(KIND=JPRB),ALLOCATABLE :: ZBUFF(:,:,:) ! Buffer to store forcing runoff
!================================================

!*** 1a. Namelist handling
CALL CMF_ICI_INPUT
CALL CMF_DRV_INPUT
!*** 1a. Namelist handling
CALL CMF_ICI_INPUT
CALL CMF_DRV_INPUT

!*** 1b. INITIALIZATION
CALL CMF_DRV_INIT
CALL CMF_ICI_INIT
!*** 1b. INITIALIZATION
CALL CMF_DRV_INIT
CALL CMF_ICI_INIT

!*** 1c. allocate data buffer for input forcing
ALLOCATE(ZBUFF(NXIN,NYIN,2))
!*** 1c. allocate data buffer for input forcing
allocate(ZBUFF(NXIN,NYIN,2))

!================================================
!*** 2. MAIN TEMPORAL LOOP / TIME-STEP (NSTEPS calculated by DRV_INIT)
!================================================
!*** 2. MAIN TEMPORAL LOOP / TIME-STEP (NSTEPS calculated by DRV_INIT)

!ISTEPADV=INT(DTIN/DT,JPIM)
!DO ISTEP=1,NSTEPS,ISTEPADV
!ISTEPADV=INT(DTIN/DT,JPIM)
!DO ISTEP=1,NSTEPS,ISTEPADV

CALL palm_TimeStart( 'Main' )
CALL palm_TimeStart( 'Main' )

ISTEPADV=1
DO ISTEP=1,NSTEPS,1
ISTEPADV=1
DO ISTEP=1,NSTEPS,1

!* 2a Get forcing from ICI
CALL palm_TimeStart( 'CAMA_forcing' )
CALL CMF_ICI_FORCING_GET
CALL palm_TimeEnd ( 'CAMA_forcing' )
!* 2a Get forcing from ICI
CALL palm_TimeStart( 'CAMA_forcing' )
CALL CMF_ICI_FORCING_GET
CALL palm_TimeEnd ( 'CAMA_forcing' )

!* 2b Advance CaMa-Flood model for ISTEPADV
CALL palm_TimeStart( 'CAMA_driver' )
CALL CMF_DRV_ADVANCE(ISTEPADV)
CALL palm_TimeEnd ( 'CAMA_driver' )

!* 2c Output data with ICI
CALL palm_TimeStart( 'CAMA_output' )
CALL CMF_ICI_OUTPUT
CALL palm_TimeEnd ( 'CAMA_output' )
!* 2b Advance CaMa-Flood model for ISTEPADV
CALL palm_TimeStart( 'CAMA_driver' )
CALL CMF_DRV_ADVANCE(ISTEPADV)
CALL palm_TimeEnd ( 'CAMA_driver' )
!* 2c Output data with ICI
CALL palm_TimeStart( 'CAMA_output' )
CALL CMF_ICI_OUTPUT
CALL palm_TimeEnd ( 'CAMA_output' )

ENDDO
CALL palm_TimeEnd ( 'Main' )
!================================================
ENDDO
CALL palm_TimeEnd ( 'Main' )
!================================================

!*** 3a. Finalize
DEALLOCATE(ZBUFF)
CALL CMF_DRV_END
CALL CMF_ICI_END
!*** 3a. Finalize
deallocate(ZBUFF)
CALL CMF_DRV_END
CALL CMF_ICI_END

!================================================
!================================================

END PROGRAM MAIN_cmf_ici
!####################################################################
Loading

0 comments on commit 5164992

Please sign in to comment.