File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -804,12 +804,20 @@ subroutine get_instance_filename(name_in,name_out)
804804 character (len=* ), intent (inout ) :: name_out ! < name_in with the filename_appendix
805805
806806 integer :: length ! < Length of name_in
807- integer :: i ! < no description
807+ integer :: i ! < Position index
808+ integer :: mom6_pos ! < Position of .mom6 substring
808809
809810 length = len_trim (name_in)
810811 name_out = name_in(1 :length)
811812
812813 if (len_trim (filename_appendix) > 0 ) then
814+ ! < If .mom6 is in the filename, add the appendix right after it
815+ mom6_pos = index (trim (name_in), " .mom6" , back= .true. )
816+ if (mom6_pos .ne. 0 ) then
817+ name_out = name_in(1 :mom6_pos+4 )// trim (filename_appendix)// name_in(mom6_pos+5 :length)
818+ return
819+ endif
820+
813821 ! < If .tileXX is in the filename add the appendix before it
814822 if (has_domain_tile_string(name_in)) then
815823 i = index (trim (name_in), " .tile" , back= .true. )
You can’t perform that action at this time.
0 commit comments