Skip to content

Commit

Permalink
create directory for ldas_ObsFcstAna
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Apr 21, 2020
1 parent 4faf62c commit ac0aab1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ subroutine output_ObsFcstAna(date_time, work_path, exp_id, &
integer, dimension(numprocs) :: N_obsl_vec, tmp_low_ind

character(300) :: fname

integer :: i
#ifdef LDAS_MPI

integer :: this_species, ind_tmp, j
Expand Down Expand Up @@ -1559,7 +1559,10 @@ subroutine output_ObsFcstAna(date_time, work_path, exp_id, &

fname = get_io_filename( work_path, exp_id, file_tag, date_time=date_time, &
dir_name=dir_name, ens_id=-1 )
i = index(fname, '/', .true.)

if( i >0) call system('mkdir -p '//fname(1:i))

This comment has been minimized.

Copy link
@gmao-rreichle

gmao-rreichle Apr 21, 2020

Contributor

@weiyuan-jiang :
I probably don't understand the full context here. But I don't think we should add system() calls into F90. We've been burned before, especially with system calls to I/O-related commands such as mkdir.
Can we not create this directory in post-processing, when it's time to move the ObsFcstAna files from scratch into their final place?
Or do we need to change this subroutine to create a file name that ends up in the scratch directory?
Whatever it is, we should avoid a system('mkdir ..') command.


open( 10, file=fname, form='unformatted', action='write')

! write header
Expand Down

0 comments on commit ac0aab1

Please sign in to comment.