24 module fms_io_utils_mod
25 use,
intrinsic :: iso_fortran_env, only: error_unit
33 mpp_get_ug_domain_ntiles, mpp_get_ug_domain_tile_id
39 character(len=32),
save :: filename_appendix =
''
71 character(len=128) :: string
72 type(char_linked_list),
pointer :: head => null()
253 subroutine error(mesg)
255 character(len=*),
intent(in) :: mesg
267 character(len=*),
intent(in) :: path
271 inquire(file=trim(path), exist=exists)
280 if (omp_get_level() .gt. 0)
then
281 call error(
"this routine is not thread-safe. Please do not" &
282 //
" call it in an OpenMP threaded region.")
292 character(len=*),
intent(in) :: string1
293 character(len=*),
intent(in) :: string2
294 logical,
intent(in),
optional :: ignore_case
297 if (len_trim(string1) .ne. len_trim(string2))
then
301 if (
present(ignore_case))
then
302 if (ignore_case)
then
303 same = trim(lowercase(string1)) .eq. trim(lowercase(string2))
307 same = trim(string1) .eq. trim(string2)
317 character(len=*),
intent(in) :: string
318 logical,
intent(in),
optional :: ignore_case
325 do while(
associated(p))
339 character(len=*),
intent(in) :: string
347 if (
associated(list))
then
349 do while (
associated(p%head))
367 do while (
associated(p))
381 character(len=*),
intent(in) :: string
382 logical :: has_string
389 i = index(trim(string),
".tile", back=.true.)
397 if (verify(string(i:i),
".") .eq. 0 .and. j .ne. i)
then
401 elseif (verify(string(i:i),
"0123456789") .ne. 0)
then
414 character(len=*),
intent(inout) :: dest
415 character(len=*),
intent(in) :: source
416 integer,
intent(in) :: domain_tile_id
421 call error(
"The file "//trim(source)//
" has a domain tile id (tileX) added. Check your open_file call")
423 i = index(trim(source),
".nc", back=.true.)
425 call error(
"The file "//trim(source)//
" does not contain .nc. Check your open_file call")
427 write(dest,
'(a,i0,a)') source(1:i-1)//
".tile", &
428 domain_tile_id, source(i:len_trim(source))
437 character(len=*),
intent(in) :: string
438 logical :: has_string
444 i = index(trim(string),
".nc.", back=.true.)
449 if (verify(string(i:i),
"0123456789") .ne. 0)
then
462 character(len=*),
intent(inout) :: dest
463 character(len=*),
intent(in) :: source
464 integer,
intent(in) :: io_domain_tile_id
467 call error(
"The file "//trim(source)// &
468 &
" has already had a domain tile id (.nc.XXXX) added. Check your open_file call.")
470 write(dest,
'(a,i4.4)') trim(source)//
".", io_domain_tile_id
479 character(len=*),
intent(in) :: string
480 logical :: has_string
482 has_string = index(trim(string),
".res.", back=.true.) .ne. 0
489 character(len=*),
intent(inout) :: dest
490 character(len=*),
intent(in) :: source
499 i = index(trim(source),
".tile", back=.true.)
501 i = index(trim(source),
".nc", back=.true.)
503 call error(
"The file "//trim(source)//
" does not contain .nc. Check your open_file call")
506 call string_copy(dest, source(1:i-1)//
".res"//source(i:len_trim(source)))
511 logical,
intent(in) :: flag
512 character(len=*),
intent(in),
optional :: fname
515 if (
present(fname))
then
516 call mpp_error(fatal,
"Error occurred while opening file "//trim(fname))
518 call mpp_error(fatal,
"Error occurred while opening file.")
525 subroutine ascii_read(ascii_filename, ascii_var, num_lines, max_length)
526 character(len=*),
intent(in) :: ascii_filename
527 character(len=:),
dimension(:),
allocatable,
intent(out) :: ascii_var
530 integer,
optional,
intent(out) :: num_lines
531 integer,
optional,
intent(out) :: max_length
532 integer,
dimension(2) :: lines_and_length
533 if(
allocated(ascii_var))
deallocate(ascii_var)
535 allocate(
character(len=lines_and_length(2))::ascii_var(lines_and_length(1)))
537 if(
present(num_lines)) num_lines = lines_and_length(1)
538 if(
present(max_length)) max_length = lines_and_length(2)
544 character(len=*),
intent(in) :: mask_table
545 logical,
intent(out) :: maskmap(:,:)
546 character(len=*),
intent(in) :: modelname
548 integer :: nmask, layout(2)
549 integer,
allocatable :: mask_list(:,:)
550 character(len=:),
dimension(:),
allocatable :: mask_table_contents
551 integer :: iocheck, n, stdoutunit, offset
552 character(len=128) :: record
557 call ascii_read(mask_table, mask_table_contents)
558 if(
mpp_pe() == mpp_root_pe() )
then
559 read(mask_table_contents(1), fmt=*, iostat=iocheck) nmask
560 if (iocheck > 0)
then
561 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error in reading nmask from file variable")
562 elseif (iocheck < 0)
then
563 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error: nmask not completely read from file variable")
565 write(stdoutunit,*)
"parse_mask_table: Number of domain regions masked in ", trim(modelname),
" = ", nmask
568 read(mask_table_contents(2), fmt=*, iostat=iocheck) layout
569 if (iocheck > 0)
then
570 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error in reading layout from file variable")
571 elseif (iocheck < 0)
then
572 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error: layout not completely read from file variable")
574 if( (layout(1) .NE.
size(maskmap,1)) .OR. (layout(2) .NE.
size(maskmap,2)) )
then
575 write(stdoutunit,*)
"layout=", layout,
", size(maskmap) = ",
size(maskmap,1),
size(maskmap,2)
576 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): layout in file "//trim(mask_table)// &
577 "does not match size of maskmap for "//trim(modelname))
581 .NE.
"fms2_io(parse_mask_table_2d): mpp_npes() layout(1)*layout(2) - nmask for "//trim(modelname))
589 allocate(mask_list(nmask,2))
591 if(
mpp_pe() == mpp_root_pe() )
then
594 do while (offset + n <
size(mask_table_contents)+1)
595 read(mask_table_contents(n+offset),
'(a)',iostat=iocheck) record
596 if (iocheck > 0)
then
597 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error in reading record from file variable")
598 elseif (iocheck < 0)
then
599 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error: record not completely read from file variable")
601 if (record(1:1) ==
'#')
then
604 elseif (record(1:10) ==
' ')
then
610 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): number of mask_list entry "// &
611 "is greater than nmask in file "//trim(mask_table) )
613 read(record,*,iostat=iocheck) mask_list(n,1), mask_list(n,2)
614 if (iocheck > 0)
then
615 call mpp_error(fatal,
"fms2_io(parse_mask_table_2d): Error in reading mask_list from record variable")
616 elseif (iocheck < 0)
then
618 &
"fms2_io(parse_mask_table_2d): Error: mask_list not completely read from record variable")
623 if( n .NE. nmask)
call mpp_error(fatal, &
624 "fms2_io(parse_mask_table_2d): number of mask_list entry does not match nmask in file "//trim(mask_table))
629 maskmap(mask_list(n,1),mask_list(n,2)) = .false.
632 deallocate(mask_list, mask_table_contents)
640 character(len=*),
intent(in) :: mask_table
641 logical,
intent(out) :: maskmap(:,:,:)
642 character(len=*),
intent(in) :: modelname
644 integer :: nmask, layout(2)
645 integer,
allocatable :: mask_list(:,:)
646 character(len=:),
dimension(:),
allocatable :: mask_table_contents
647 integer :: iocheck, n, stdoutunit, ntiles, offset
648 character(len=128) :: record
653 call ascii_read(mask_table, mask_table_contents)
654 if(
mpp_pe() == mpp_root_pe() )
then
655 read(mask_table_contents(1), fmt=*, iostat=iocheck) nmask
656 if (iocheck > 0)
then
657 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error in reading nmask from file variable")
658 elseif (iocheck < 0)
then
659 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error: nmask not completely read from file variable")
661 write(stdoutunit,*)
"parse_mask_table: Number of domain regions masked in ", trim(modelname),
" = ", nmask
664 read(mask_table_contents(2), fmt=*, iostat=iocheck) layout(1), layout(2), ntiles
665 if (iocheck > 0)
then
666 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error in reading layout from file variable")
667 elseif (iocheck < 0)
then
668 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error: layout not completely read from file variable")
670 if( (layout(1) .NE.
size(maskmap,1)) .OR. (layout(2) .NE.
size(maskmap,2)) )
then
671 write(stdoutunit,*)
"layout=", layout,
", size(maskmap) = ",
size(maskmap,1),
size(maskmap,2)
672 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): layout in file "//trim(mask_table)// &
673 "does not match size of maskmap for "//trim(modelname))
675 if( ntiles .NE.
size(maskmap,3) )
then
676 write(stdoutunit,*)
"ntiles=", ntiles,
", size(maskmap,3) = ",
size(maskmap,3)
677 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): ntiles in file "//trim(mask_table)// &
678 "does not match size of maskmap for "//trim(modelname))
681 if(
mpp_npes() .NE. layout(1)*layout(2)*ntiles - nmask )
then
682 print*,
"layout=", layout, nmask,
mpp_npes()
684 .NE.
"fms2_io(parse_mask_table_3d): mpp_npes() layout(1)*layout(2) - nmask for "//trim(modelname))
693 allocate(mask_list(nmask,3))
695 if(
mpp_pe() == mpp_root_pe() )
then
698 do while (offset + n <
size(mask_table_contents)+1)
699 read(mask_table_contents(n+offset),
'(a)',iostat=iocheck) record
700 if (iocheck > 0)
then
701 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error in reading record from file variable")
702 elseif (iocheck < 0)
then
703 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error: record not completely read from file variable")
705 if (record(1:1) ==
'#')
then
708 elseif (record(1:10) ==
' ')
then
714 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): number of mask_list entry "// &
715 "is greater than nmask in file "//trim(mask_table) )
717 read(record,*,iostat=iocheck) mask_list(n,1), mask_list(n,2), mask_list(n,3)
718 if (iocheck > 0)
then
719 call mpp_error(fatal,
"fms2_io(parse_mask_table_3d): Error in reading mask_list from record variable")
720 elseif (iocheck < 0)
then
722 &
"fms2_io(parse_mask_table_3d): Error: mask_list not completely read from record variable")
727 if( n .NE. nmask)
call mpp_error(fatal, &
728 "fms2_io(parse_mask_table_3d): number of mask_list entry does not match nmask in file "//trim(mask_table))
734 maskmap(mask_list(n,1),mask_list(n,2),mask_list(n,3)) = .false.
736 deallocate(mask_list, mask_table_contents)
742 character(len=*),
intent(in) :: file_in
743 character(len=*),
intent(out) :: file_out
744 logical,
intent(in) :: is_no_domain
746 type(
domain2d),
intent(in),
optional,
target :: domain
747 integer,
intent(in),
optional :: tile_count
749 character(len=FMS_FILE_LEN) :: basefile
750 character(len=6) :: tilename
751 character(len=2) :: my_tile_str
752 integer :: lens, ntiles, ntileMe, tile, my_tile_id
753 integer,
dimension(:),
allocatable :: tile_id
754 type(
domain2d),
pointer,
save :: d_ptr =>null()
755 logical :: domain_exist
757 if(index(file_in,
'.nc', back=.true.)==0)
then
758 basefile = trim(file_in)
760 lens = len_trim(file_in)
761 if(file_in(lens-2:lens) .NE.
'.nc')
call mpp_error(fatal, &
762 'get_mosaic_tile_file_sg: .nc should be at the end of file '//trim(file_in))
763 basefile = file_in(1:lens-3)
769 domain_exist = .false.
770 if(
PRESENT(domain))
then
771 domain_exist = .true.
776 if(domain_exist)
then
778 allocate(tile_id(ntileme))
781 if(
present(tile_count)) tile = tile_count
782 my_tile_id = tile_id(tile)
785 if(ntiles > 1 .or. my_tile_id > 1 )
then
786 write(my_tile_str,
'(I0)') my_tile_id
787 tilename =
'tile'//trim(my_tile_str)
788 if(index(basefile,
'.'//trim(tilename),back=.true.) == 0)
then
789 basefile = trim(basefile)//
'.'//trim(tilename);
792 if(
allocated(tile_id))
deallocate(tile_id)
794 file_out = trim(basefile)//
'.nc'
803 character(len=*),
intent(in) :: file_in
804 character(len=*),
intent(out) :: file_out
805 type(
domainug),
intent(in),
optional :: domain
807 character(len=FMS_FILE_LEN) :: basefile
808 character(len=6) :: tilename
809 character(len=2) :: my_tile_str
810 integer :: lens, ntiles, my_tile_id
812 if(index(file_in,
'.nc', back=.true.)==0)
then
813 basefile = trim(file_in)
815 lens = len_trim(file_in)
816 if(file_in(lens-2:lens) .NE.
'.nc')
call mpp_error(fatal, &
817 'fms_io_mod: .nc should be at the end of file '//trim(file_in))
818 basefile = file_in(1:lens-3)
824 if(
PRESENT(domain))
then
825 ntiles = mpp_get_ug_domain_ntiles(domain)
826 my_tile_id = mpp_get_ug_domain_tile_id(domain)
829 if(ntiles > 1 .or. my_tile_id > 1 )
then
830 write(my_tile_str,
'(I0)') my_tile_id
831 tilename =
'tile'//trim(my_tile_str)
832 if(index(basefile,
'.'//trim(tilename),back=.true.) == 0)
then
833 basefile = trim(basefile)//
'.'//trim(tilename);
837 file_out = trim(basefile)//
'.nc'
843 character(len=*) ,
intent(out) :: string_out
845 string_out = trim(filename_appendix)
852 filename_appendix =
''
859 character(len=*) ,
intent(in) :: string_in
862 if (len_trim(filename_appendix) > 0)
then
863 call error(
"Set_filename_appendix: The filename appendix has already be set " &
864 //
"call 'nullify_filename_appendix' first")
867 filename_appendix = trim(string_in)
873 character(len=*) ,
intent(in) :: name_in
874 character(len=*),
intent(inout) :: name_out
879 length = len_trim(name_in)
880 name_out = name_in(1:length)
882 if(len_trim(filename_appendix) > 0)
then
885 i = index(trim(name_in),
".tile", back=.true.)
886 name_out = name_in(1:i-1) //
'.'//trim(filename_appendix)//name_in(i:length)
891 i = index(trim(name_in),
".nc", back=.true.)
893 name_out = name_in(1:i-1)//
'.'//trim(filename_appendix)//name_in(i:length)
895 i = index(trim(name_in),
".yaml", back=.true.)
898 name_out = name_in(1:i-1)//
'.'//trim(filename_appendix)//name_in(i:length)
901 name_out = name_in(1:length) //
'.'//trim(filename_appendix)
908 include
"array_utils.inc"
909 include
"array_utils_char.inc"
910 include
"get_data_type_string.inc"
913 end module fms_io_utils_mod
subroutine allocate_array_r8_kind_1d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine get_data_type_string_4d(sdata, type_string)
Return a string describing the input data's type.
subroutine put_array_section_i8_kind_2d(section, array, s, c)
Put a section of an array into a larger array.
subroutine put_array_section_r8_kind_4d(section, array, s, c)
Put a section of an array into a larger array.
subroutine allocate_array_char_5d(buf, sizes, initialize)
Allocate character arrays using an input array of sizes.
subroutine put_array_section_i4_kind_2d(section, array, s, c)
Put a section of an array into a larger array.
subroutine put_array_section_i4_kind_1d(section, array, s, c)
Put a section of an array into a larger array.
subroutine, public get_instance_filename(name_in, name_out)
Adds the filename_appendix to name_in and sets it as name_out.
subroutine allocate_array_char_3d(buf, sizes, initialize)
Allocate character arrays using an input array of sizes.
subroutine get_array_section_i8_kind_4d(section, array, s, c)
Get a section of larger array.
logical function has_io_domain_tile_string(string)
Determine if the "I/O domain tile string" (.nc.xxxx) exists in the input filename.
subroutine get_array_section_r4_kind_3d(section, array, s, c)
Get a section of larger array.
subroutine, public ascii_read(ascii_filename, ascii_var, num_lines, max_length)
Read the ascii text from filename ascii_filenameinto string array ascii_var
subroutine get_mosaic_tile_file_ug(file_in, file_out, domain)
Determine tile_file for unstructured grid based on filename and current tile on mpp_domain (this is m...
subroutine get_array_section_r8_kind_1d(section, array, s, c)
Get a section of larger array.
subroutine get_array_section_i8_kind_3d(section, array, s, c)
Get a section of larger array.
subroutine allocate_array_i8_kind_2d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine put_array_section_i4_kind_3d(section, array, s, c)
Put a section of an array into a larger array.
subroutine, public restart_filepath_mangle(dest, source)
Add ".res" to an input file path.
subroutine put_array_section_r8_kind_2d(section, array, s, c)
Put a section of an array into a larger array.
subroutine put_array_section_r8_kind_3d(section, array, s, c)
Put a section of an array into a larger array.
subroutine get_array_section_i8_kind_5d(section, array, s, c)
Get a section of larger array.
subroutine get_data_type_string_5d(sdata, type_string)
Return a string describing the input data's type.
subroutine get_array_section_r4_kind_1d(section, array, s, c)
Get a section of larger array.
logical function, public file_exists(path)
Determine if a file exists.
subroutine put_array_section_i8_kind_1d(section, array, s, c)
Put a section of an array into a larger array.
subroutine put_array_section_i8_kind_5d(section, array, s, c)
Put a section of an array into a larger array.
subroutine allocate_array_r4_kind_3d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_i8_kind_1d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine parse_mask_table_2d(mask_table, maskmap, modelname)
Populate 2D maskmap from mask_table given a model.
subroutine allocate_array_r8_kind_4d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_r8_kind_3d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine, public open_check(flag, fname)
logical function has_restart_string(string)
Determine if the "restart string" (.res.) exists in the input filename.
subroutine, public nullify_filename_appendix()
Clears the filename_appendix module variable.
subroutine, public io_domain_tile_filepath_mangle(dest, source, io_domain_tile_id)
Add the I/O domain tile id to an input filepath.
subroutine allocate_array_i8_kind_5d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_i4_kind_2d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine, public get_filename_appendix(string_out)
Writes filename appendix to "string_out".
subroutine allocate_array_r4_kind_1d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine, public set_filename_appendix(string_in)
Save "string_in" as a module variable that will added to the filename of the restart files.
subroutine get_array_section_r8_kind_5d(section, array, s, c)
Get a section of larger array.
logical function, public string_compare(string1, string2, ignore_case)
Compare strings.
subroutine get_data_type_string_1d(sdata, type_string)
Return a string describing the input data's type.
subroutine put_array_section_r4_kind_5d(section, array, s, c)
Put a section of an array into a larger array.
subroutine allocate_array_char_4d(buf, sizes, initialize)
Allocate character arrays using an input array of sizes.
subroutine allocate_array_r8_kind_5d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_r4_kind_4d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine get_array_section_i4_kind_5d(section, array, s, c)
Get a section of larger array.
subroutine allocate_array_char_6d(buf, sizes, initialize)
Allocate character arrays using an input array of sizes.
subroutine get_array_section_i4_kind_3d(section, array, s, c)
Get a section of larger array.
subroutine allocate_array_r4_kind_2d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_i4_kind_4d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine put_array_section_i8_kind_4d(section, array, s, c)
Put a section of an array into a larger array.
subroutine allocate_array_i4_kind_3d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine put_array_section_r4_kind_3d(section, array, s, c)
Put a section of an array into a larger array.
subroutine parse_mask_table_3d(mask_table, maskmap, modelname)
Populate 3D maskmap from mask_table given a model.
subroutine get_mosaic_tile_file_sg(file_in, file_out, is_no_domain, domain, tile_count)
Determine tile_file for structured grid based on filename and current tile on mpp_domain (this is mos...
subroutine get_data_type_string_0d(sdata, type_string)
Return a string describing the input data's type.
subroutine get_array_section_i8_kind_1d(section, array, s, c)
Get a section of larger array.
subroutine get_array_section_r4_kind_4d(section, array, s, c)
Get a section of larger array.
subroutine put_array_section_r8_kind_1d(section, array, s, c)
Put a section of an array into a larger array.
subroutine get_array_section_i4_kind_2d(section, array, s, c)
Get a section of larger array.
subroutine get_data_type_string_3d(sdata, type_string)
Return a string describing the input data's type.
subroutine get_array_section_r8_kind_2d(section, array, s, c)
Get a section of larger array.
subroutine, public destroy_list(list)
Deallocate all nodes on a character linked list.
subroutine get_array_section_r8_kind_4d(section, array, s, c)
Get a section of larger array.
logical function has_domain_tile_string(string)
Determine if the "domain tile string" (.tilex.) exists in the input filename.
subroutine allocate_array_i8_kind_3d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine get_data_type_string_2d(sdata, type_string)
Return a string describing the input data's type.
subroutine put_array_section_i4_kind_5d(section, array, s, c)
Put a section of an array into a larger array.
subroutine get_array_section_i4_kind_4d(section, array, s, c)
Get a section of larger array.
subroutine, public append_to_list(list, string)
Add node to character linked list.
subroutine put_array_section_i4_kind_4d(section, array, s, c)
Put a section of an array into a larger array.
subroutine, public openmp_thread_trap()
Catch OpenMP parallel machines.
subroutine allocate_array_i4_kind_5d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_char_1d(buf, sizes, initialize)
Allocate character arrays using an input array of sizes.
subroutine allocate_array_r4_kind_5d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_i4_kind_1d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine put_array_section_r8_kind_5d(section, array, s, c)
Put a section of an array into a larger array.
subroutine get_array_section_i4_kind_1d(section, array, s, c)
Get a section of larger array.
subroutine put_array_section_i8_kind_3d(section, array, s, c)
Put a section of an array into a larger array.
subroutine get_array_section_i8_kind_2d(section, array, s, c)
Get a section of larger array.
subroutine put_array_section_r4_kind_1d(section, array, s, c)
Put a section of an array into a larger array.
subroutine allocate_array_i8_kind_4d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine put_array_section_r4_kind_4d(section, array, s, c)
Put a section of an array into a larger array.
subroutine allocate_array_r8_kind_2d(buf, sizes)
Allocate arrays using an input array of sizes.
subroutine allocate_array_char_2d(buf, sizes, initialize)
Allocate character arrays using an input array of sizes.
subroutine, public domain_tile_filepath_mangle(dest, source, domain_tile_id)
Add the domain tile id to an input filepath.
logical function, public is_in_list(list, string, ignore_case)
Determine if a string exists in a character linked list.
subroutine get_array_section_r4_kind_2d(section, array, s, c)
Get a section of larger array.
subroutine get_array_section_r8_kind_3d(section, array, s, c)
Get a section of larger array.
subroutine get_array_section_r4_kind_5d(section, array, s, c)
Get a section of larger array.
subroutine put_array_section_r4_kind_2d(section, array, s, c)
Put a section of an array into a larger array.
Interface to allocate data real, integer, or character buffers for use in read/write routines....
Utility routine that copies a subset of data from a larger array into a smaller one using the startin...
Sets a string describing the datatype corresponding to the sdata argument Example:
Constructs the file name to be used when utilizing a multi-tile mosaic. This is currenly used in the ...
Reads in the mask_table file in the ASCII format from a given path and populates a maskmap array that...
Utility routine that copies a smaller array into a larger one using the starting indices and sizes pr...
A linked list of strings.
subroutine, public string_copy(dest, source, check_for_null)
Safely copy a string from one buffer to another.
integer function, dimension(size(domain%tile_id(:))) mpp_get_tile_id(domain)
Returns the tile_id on current pe.
integer function mpp_get_current_ntile(domain)
Returns number of tile on current pe.
integer function mpp_get_ntile_count(domain)
Returns number of tiles in mosaic.
The domain2D type contains all the necessary information to define the global, compute and data domai...
Domain information for managing data on unstructured grids.
integer function stdout()
This function returns the current standard fortran unit numbers for output.
subroutine read_ascii_file(FILENAME, LENGTH, Content, PELIST)
Reads any ascii file into a character array and broadcasts it to the non-root mpi-tasks....
integer function mpp_npes()
Returns processor count for current pelist.
integer function, dimension(2) get_ascii_file_num_lines_and_length(FILENAME, PELIST)
Function to determine the maximum line length and number of lines from an ascii file.
integer function mpp_pe()
Returns processor ID.
Perform parallel broadcasts.