From d12034480b27c23ad0e239fbd83ec0184e2fb141 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Thu, 12 Jan 2023 15:46:17 -0700 Subject: [PATCH] Windows: Replace `system` calls with equivalent Fortran/C calls Fix intermittent failure of `system` commands on Windows: occasionally the system calls would fail to finish and make the program hang or end prematurely without any error message. --- modules/nwtc-library/src/SysIVF.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nwtc-library/src/SysIVF.f90 b/modules/nwtc-library/src/SysIVF.f90 index 603ad6da7..2a6304dbd 100644 --- a/modules/nwtc-library/src/SysIVF.f90 +++ b/modules/nwtc-library/src/SysIVF.f90 @@ -193,18 +193,18 @@ END SUBROUTINE Get_CWD !> This routine creates a given directory if it does not already exist. SUBROUTINE MKDIR ( new_directory_path ) + USE IFPORT, ONLY: MAKEDIRQQ implicit none character(*), intent(in) :: new_directory_path - character(1024) :: make_command logical :: directory_exists + logical :: success ! Check if the directory exists first inquire( directory=trim(new_directory_path), exist=directory_exists ) if ( .NOT. directory_exists ) then - make_command = 'mkdir "'//trim(new_directory_path)//'"' - call system( make_command ) + success = MAKEDIRQQ( trim(new_directory_path) ) endif END SUBROUTINE MKDIR