mirror of
https://gitlab.com/scemama/irpf90.git
synced 2025-01-03 01:55:42 +01:00
Fix writer
This commit is contained in:
parent
5379700a3d
commit
ea5fa02b26
@ -1,5 +1,5 @@
|
||||
IRPF90= irpf90
|
||||
IRPF90FLAGS= -I ./ -I input/
|
||||
IRPF90= ../bin/irpf90
|
||||
IRPF90FLAGS=
|
||||
BUILD_SYSTEM= make
|
||||
|
||||
.EXPORT_ALL_VARIABLES:
|
||||
@ -50,7 +50,7 @@ define run_and_touch
|
||||
$(BUILD_SYSTEM) -C $(dir $(1) ) -f $(notdir $(1) ) $(addprefix $(CURDIR)/, $(2)) && touch $(2)
|
||||
endef
|
||||
|
||||
EXE := $(shell egrep -r '^\s*program' *.irp.f | awk '{print $$2}')
|
||||
EXE := $(shell egrep -ri '^\s*program' *.irp.f | cut -d'.' -f1)
|
||||
|
||||
.PHONY: all
|
||||
|
||||
|
@ -178,17 +178,19 @@ class Entity(object):
|
||||
'group_entity': [{
|
||||
'name': n,
|
||||
'dim': build_dim(
|
||||
self.cm_d_variable[n].dim, colons=True)
|
||||
self.d_entity[n].dim, colons=True)
|
||||
} for n in self.l_name]
|
||||
}
|
||||
|
||||
return ashes_env('io.f90', d_template).split('\n')
|
||||
return ashes_env.render('ioer.f90', d_template).split('!TOKEN_SPLIT')
|
||||
|
||||
@irpy.lazy_property
|
||||
def reader(self):
|
||||
return io.er.split('TOKEN_SPLIT')[0]
|
||||
return self.io_er[1].split('\n')
|
||||
|
||||
@irpy.lazy_property
|
||||
def writer(self):
|
||||
return io.er.split('TOKEN_SPLIT')[1]
|
||||
return self.io_er[0].split('\n')
|
||||
|
||||
@irpy.lazy_property_mutable
|
||||
def is_read(self):
|
||||
|
@ -114,7 +114,6 @@ class Fmodule(object):
|
||||
result += var.reader
|
||||
if var.is_written:
|
||||
result += var.writer
|
||||
|
||||
return result
|
||||
|
||||
@irpy.lazy_property
|
||||
|
@ -1,4 +1,4 @@
|
||||
SUBROUTINE write_{name}(irp_num)
|
||||
SUBROUTINE writer_{name}(irp_num)
|
||||
|
||||
USE {fmodule}
|
||||
IMPLICIT NONE
|
||||
@ -17,28 +17,28 @@ SUBROUTINE write_{name}(irp_num)
|
||||
CALL provide_{same_as}
|
||||
ENDIF
|
||||
|
||||
{children}
|
||||
CALL write_{.}(irp_num)
|
||||
{#children}
|
||||
CALL writer_{.}(irp_num)
|
||||
{/children}
|
||||
|
||||
DO WHILE (irp_is_open)
|
||||
irp_iunit = irp_inuit + 1
|
||||
INQUIRE(UNIT=irp_inuit, OPENED=irp_is_open)
|
||||
irp_iunit = irp_iunit + 1
|
||||
INQUIRE(UNIT=irp_iunit, OPENED=irp_is_open)
|
||||
END DO
|
||||
|
||||
{#group_entity}
|
||||
OPEN(UNIT=irp_inuit,file='irpf90_{name}_'//trim(irp_num),FROM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||
WRITE(irp_inuit,*) {.}{dim}
|
||||
CLOSE(irp_inuit)
|
||||
OPEN(UNIT=irp_iunit,file='irpf90_{name}_'//trim(irp_num),FORM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||
WRITE(irp_iunit,*) {name}{dim}
|
||||
CLOSE(irp_iunit)
|
||||
{/group_entity}
|
||||
|
||||
{?do_debug} CALL irp_leave(irp_here) {/do_debug}
|
||||
|
||||
END SUBROUTINE write_{name}
|
||||
END SUBROUTINE writer_{name}
|
||||
|
||||
!TOKEN_SPLIT
|
||||
|
||||
SUBROUTINE read_{name}(irp_num)
|
||||
SUBROUTINE reader_{name}(irp_num)
|
||||
|
||||
USE {fmodule}
|
||||
IMPLICIT NONE
|
||||
@ -54,18 +54,18 @@ SUBROUTINE read_{name}(irp_num)
|
||||
{?do_debug} CALL irp_enter(irp_here) {/do_debug}
|
||||
|
||||
DO WHILE (irp_is_open)
|
||||
irp_iunit = irp_inuit + 1
|
||||
INQUIRE(UNIT=irp_inuit, OPENED=irp_is_open)
|
||||
irp_iunit = irp_iunit + 1
|
||||
INQUIRE(UNIT=irp_iunit, OPENED=irp_is_open)
|
||||
END DO
|
||||
|
||||
{#group_entity}
|
||||
OPEN(UNIT=irp_inuit,file='irpf90_{name}_'//trim(irp_num),FROM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||
READ(irp_inuit,*) {name}{dim}
|
||||
CLOSE(irp_inuit)
|
||||
OPEN(UNIT=irp_iunit,file='irpf90_{name}_'//trim(irp_num),FORM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||
READ(irp_iunit,*) {name}{dim}
|
||||
CLOSE(irp_iunit)
|
||||
{/group_entity}
|
||||
|
||||
CALL touch_{name}
|
||||
{?do_debug} CALL irp_leave(irp_here) {/do_debug}
|
||||
|
||||
END SUBROUTINE read_{name}
|
||||
END SUBROUTINE reader_{name}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user