diff --git a/Common/get_slice_dir.f90 b/Common/get_slice_dir.f90 new file mode 100644 index 0000000000000000000000000000000000000000..92de13876ba4715a5563ceab364abfcfe7d39c29 --- /dev/null +++ b/Common/get_slice_dir.f90 @@ -0,0 +1,29 @@ +module get_slice_dir_m + + implicit none + +contains + + pure function get_slice_dir(shpc_dir, cyclone, slice) + + character(len = :), allocatable:: get_slice_dir + character(len = *), intent(in):: shpc_dir + logical, intent(in):: cyclone + integer, intent(in):: slice + + ! Local: + character(len = 10) slice_part + + !------------------------------------------------------------- + + write(unit = slice_part, fmt = "(a, i0)") "Slice_", slice + + if (cyclone) then + get_slice_dir = shpc_dir // "/Cyclones/" // trim(slice_part) + else + get_slice_dir = shpc_dir // "/Anticyclones/" // trim(slice_part) + end if + + end function get_slice_dir + +end module get_slice_dir_m