Intializes a single monitor.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(monitor_obj), | intent(inout) | :: | this |
A monitor object |
||
| character(len=*), | intent(in) | :: | name |
Name of the monitor |
||
| integer, | intent(in) | :: | ncol |
Number of columns |
||
| character(len=*), | intent(in), | optional | :: | sep |
Column separator |
impure subroutine monitor_obj_Init(this,name,ncol,sep) !> Intializes a single monitor. implicit none class(monitor_obj), intent(inout) :: this !! A monitor object character(len=*), intent(in) :: name !! Name of the monitor integer, intent(in) :: ncol !! Number of columns character(len=*), intent(in), & optional :: sep !! Column separator ! Work variables type(sysutils_obj) :: sysutils ! Set the name this%name=trim(name) ! Set the column seperator if (present(sep)) then if(len(sep).ne.1) stop "Cannot use a separtor that is larger than one character" this%sep=sep else this%sep=" " end if ! Set the number of columns if( ncol.le.0) stop "Cannot initialize a monitor with less than 1 column" allocate(this%col(ncol)) ! Initialize labels to a default value this%col(:)%label="UNASSIGNED" ! Define formats call this%Formats ! Do we print to stdout or file if (.not.this%stdout) then ! Create monitor directory if it doesn't exist call sysutils%CreateDirectory(baseDirName) ! Open file open(newunit=this%fid, file=baseDirName//'/'//baseFileName//trim(adjustl(this%name)),status="replace") else ! Connect to stdout this%fid=6 end if return end subroutine monitor_obj_Init