Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libmtime
Commits
267bbdaf
Commit
267bbdaf
authored
11 years ago
by
Luis Kornblueh
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some monir problems.
parent
982bc8cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/iconatm.f90
+184
-0
184 additions, 0 deletions
test/iconatm.f90
test/iconoce.f90
+2
-0
2 additions, 0 deletions
test/iconoce.f90
with
186 additions
and
0 deletions
test/iconatm.f90
0 → 100644
+
184
−
0
View file @
267bbdaf
program
iconatm
use
mtime
implicit
none
character
(
len
=
max_calendar_str_len
)
::
calendar_in_use
character
(
len
=
max_datetime_str_len
)
::
dstring
character
(
len
=
max_timedelta_str_len
)
::
tdstring
type
(
datetime
),
pointer
::
experiment_start_date
=>
null
()
type
(
datetime
),
pointer
::
experiment_stop_date
=>
null
()
type
(
datetime
),
pointer
::
start_date
=>
null
()
type
(
datetime
),
pointer
::
stop_date
=>
null
()
type
(
timedelta
),
pointer
::
dynamic_time_step
=>
null
()
type
(
timedelta
),
pointer
::
advection_time_step
=>
null
()
type
(
timedelta
),
pointer
::
radiation_time_step
=>
null
()
type
(
timedelta
),
pointer
::
convection_time_step
=>
null
()
type
(
timedelta
),
pointer
::
cloud_cover_time_step
=>
null
()
type
(
timedelta
),
pointer
::
sso_time_step
=>
null
()
type
(
timedelta
),
pointer
::
gwdrag_time_step
=>
null
()
type
(
timedelta
),
pointer
::
checkpoint_time_step
=>
null
()
type
(
timedelta
),
pointer
::
restart_time_step
=>
null
()
type
(
timedelta
),
pointer
::
coupling_time_step
=>
null
()
type
(
timedelta
),
pointer
::
model_time_step
=>
null
()
type
(
datetime
),
pointer
::
current_date
=>
null
()
! setup of calendar
call
setCalendar
(
year_of_365_days
)
! proleptic_gregorian/year_of_365_days/year_of_360_days.
call
calendarToString
(
calendar_in_use
)
print
*
,
'Calendar: '
,
TRIM
(
calendar_in_use
)
! set defaults for dates
start_date
=>
newDatetime
(
'1978-01-01'
)
call
datetimeToString
(
start_date
,
dstring
)
print
*
,
'Start date: '
,
trim
(
dstring
)
stop_date
=>
newDatetime
(
'2008-01-01'
)
call
datetimeToString
(
stop_date
,
dstring
)
print
*
,
'Stop date : '
,
trim
(
dstring
)
experiment_start_date
=
start_date
call
datetimeToString
(
experiment_start_date
,
dstring
)
print
*
,
'Experiment start date: '
,
trim
(
dstring
)
experiment_stop_date
=
stop_date
call
datetimeToString
(
experiment_stop_date
,
dstring
)
print
*
,
'Experiment stop date : '
,
trim
(
dstring
)
dynamic_time_step
=>
newTimedelta
(
'PT120S'
)
call
timedeltaToString
(
dynamic_time_step
,
tdstring
)
print
*
,
'Dynamics tim step: '
,
trim
(
tdstring
)
advection_time_step
=>
newTimedelta
(
'PT600S'
)
radiation_time_step
=>
newTimedelta
(
'PT1800S'
)
convection_time_step
=>
newTimedelta
(
'PT600S'
)
cloud_cover_time_step
=>
newTimedelta
(
'PT600S'
)
sso_time_step
=>
newTimedelta
(
'PT1200S'
)
gwdrag_time_step
=>
newTimedelta
(
'PT1200S'
)
checkpoint_time_step
=>
newTimedelta
(
'PT86400S'
)
restart_time_step
=>
newTimedelta
(
'P1M'
)
coupling_time_step
=>
newTimedelta
(
'PT21600S'
)
model_time_step
=>
newTimedelta
(
'PT600S'
)
! time_step => newTimedelta('PT12H')
! call timedeltaToString(time_step, time_step_string)
! print *, 'Model time step : ', trim(time_step_string)
! current_date => newDatetime('2012-09-01T02:10:00.000')
! ! copy operator - overload newDatetime using construct and copy!
! ! current_date = start_date
! call datetimeToString(current_date, current_date_string)
! print *, 'Model time : ', trim(current_date_string)
! time_integration: do
! current_date = current_date + time_step
! call datetimeToString(current_date, current_date_string)
! print *, 'Model time loop : ', trim(current_date_string)
! if (current_date >= stop_date) exit time_integration
! enddo time_integration
! call datetimeToString(current_date, current_date_string)
! print *, 'Model stop time : ', trim(current_date_string)
! ! cleanup of objects
! call deallocateDatetime(start_date)
! call deallocateDatetime(stop_date)
! call deallocateDatetime(current_date)
! call deallocateTimeDelta(time_step)
! call event_tests
! ! reset calendar
! call resetCalendar()
! contains
! subroutine event_tests
! type(eventgroup), pointer :: outputEventGroup
! type(event), pointer :: outputEvent
! type(event), pointer :: checkpointEvent
! type(event), pointer :: restartEvent
! type(event), pointer :: currentEvent
! type(datetime), pointer :: dtt
! type(timedelta), pointer :: tdd
! character(len=max_eventname_str_len) :: currentEventString
! logical :: lret
! character(len=max_eventname_str_len) :: aa
! character(len=max_groupname_str_len) :: bb
! character(len=max_datetime_str_len) :: current_date_string_tmp
! outputEventGroup => newEventGroup('output driver')
! call getEventGroupName(outputEventGroup, aa)
! print *, aa
! outputEvent => newEvent('output', '2000-01-01T00:00:00', '2010-01-01T00:00:01', '2013-01-01T00:00:02', 'PT06H')
! lret = addEventToEventGroup(outputEvent, outputEventGroup)
! dtt => getEventReferenceDateTime(outputEvent)
! call datetimeToString(dtt, current_date_string_tmp)
! print *, trim(current_date_string_tmp)
! dtt => getEventFirstDateTime(outputEvent)
! call datetimeToString(dtt, current_date_string_tmp)
! print *, trim(current_date_string_tmp)
! dtt => getEventLastDateTime(outputEvent)
! call datetimeToString(dtt, current_date_string_tmp)
! print *, trim(current_date_string_tmp)
! tdd => getEventInterval(outputEvent)
! call timedeltaToString(tdd, current_date_string_tmp)
! print *, trim(current_date_string_tmp)
! checkpointEvent => newEvent('checkpoint', '2010-01-01T00:00:00', '2010-01-01T00:00:00', '2013-01-01T00:00:00', 'P05D')
! lret = addEventToEventGroup(checkpointEvent, outputEventGroup)
! restartEvent => newEvent('restart', '2000-01-01T00:00:00', '2010-01-01T00:00:00', '2013-01-01T00:00:00', 'P01M')
! lret = addEventToEventGroup(restartEvent, outputEventGroup)
! currentEvent => getFirstEventFromEventGroup(outputEventGroup)
! print *, 'Event list: '
! do while (associated(currentEvent))
! call getEventName(currentEvent, currentEventString)
! print *,' event: ', trim(currentEventString)
! currentEvent => getNextEventFromEventGroup(currentEvent)
! enddo
! print *,'HELLO' ,getEventId(restartEvent);
! print *, 'GOOGLE', getEventisFirstInMonth(outputEvent)
! !type(datetime), pointer :: current_date_test
! current_date_test => newDatetime('2010-01-02T00:00:00')
! tmp_date_test_1 => newDatetime('2000-01-01T01:00:00')
! call getTriggeredPreviousEventAtDateTime(checkpointEvent, tmp_date_test_1)
! call datetimeToString(tmp_date_test_1, current_date_string)
! print *, current_date_string
! call getEventGroupName(outputEventGroup, bb);
! print *, bb
! call deallocateEventGroup(outputEventGroup)
! end subroutine event_tests
end
program
iconatm
This diff is collapsed.
Click to expand it.
test/iconoce.f90
0 → 100644
+
2
−
0
View file @
267bbdaf
program
iconoce
end
program
iconoce
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment