Skip to content

Commit

Permalink
Moved some instructions that are executed only once outside the main …
Browse files Browse the repository at this point in the history
…driver loops.
  • Loading branch information
micaeljtoliveira committed Jan 6, 2025
1 parent abadde1 commit 693f820
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
15 changes: 8 additions & 7 deletions src/offline/cable_mpimaster.F90
Original file line number Diff line number Diff line change
Expand Up @@ -334,23 +334,24 @@ SUBROUTINE mpidrv_master (comm, trunk_sumbal, dels, koffset, kend, PLUME, CRU)

! END header

!ccc Set "calendar" for netcdf time attribute
calendar = "noleap"
IF ( leaps ) THEN
calendar = "standard"
END IF

! outer loop - spinup loop no. ktau_tot :
ktau = 0
SPINLOOP:DO
YEARLOOP: DO YYYY= CABLE_USER%YearStart, CABLE_USER%YearEnd

CurYear = YYYY

!ccc Set calendar attribute: dependant on the value of `leaps`
! that is set in the MetType if conditions above.
calendar = "noleap"
!ccc Set number of days in the year
LOY = 365
IF ( leaps ) THEN
calendar = "standard"
ENDIF
IF ( leaps .AND. IS_LEAPYEAR( YYYY ) ) THEN
LOY = 366
ENDIF
END IF

SELECT CASE (TRIM(cable_user%MetType))
CASE ('gswp')
Expand Down
12 changes: 6 additions & 6 deletions src/offline/cable_serial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ SUBROUTINE serialdrv(trunk_sumbal, NRRRR, dels, koffset, kend, GSWP_MID, PLUME,

! INISTUFF

!ccc Set "calendar" for netcdf time attribute
calendar = "noleap"
IF ( leaps ) THEN
calendar = "standard"
END IF

! outer loop - spinup loop no. ktau_tot :
ktau = 0
Expand All @@ -284,13 +289,8 @@ SUBROUTINE serialdrv(trunk_sumbal, NRRRR, dels, koffset, kend, GSWP_MID, PLUME,

CurYear = YYYY

!ccc Set "calendar" for netcdf time attribute and
! number of days in the year
calendar = "noleap"
!ccc Set number of days in the year
LOY = 365
IF ( leaps ) THEN
calendar = "standard"
END IF
IF ( leaps .AND. IS_LEAPYEAR( YYYY ) ) THEN
LOY = 366
END IF
Expand Down

0 comments on commit 693f820

Please sign in to comment.