libsim Versione 7.2.0
|
◆ vol7d_ana_write_unit()
This method writes on a Fortran file unit the contents of the object this. The record can successively be read by the ::read_unit method. The method works both on formatted and unformatted files.
Definizione alla linea 546 del file vol7d_ana_class.F90. 547! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
548! authors:
549! Davide Cesari <dcesari@arpa.emr.it>
550! Paolo Patruno <ppatruno@arpa.emr.it>
551
552! This program is free software; you can redistribute it and/or
553! modify it under the terms of the GNU General Public License as
554! published by the Free Software Foundation; either version 2 of
555! the License, or (at your option) any later version.
556
557! This program is distributed in the hope that it will be useful,
558! but WITHOUT ANY WARRANTY; without even the implied warranty of
559! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
560! GNU General Public License for more details.
561
562! You should have received a copy of the GNU General Public License
563! along with this program. If not, see <http://www.gnu.org/licenses/>.
564#include "config.h"
565
574IMPLICIT NONE
575
577INTEGER,PARAMETER :: vol7d_ana_lenident=20
578
584 TYPE(geo_coord) :: coord
585 CHARACTER(len=vol7d_ana_lenident) :: ident
587
590
595 MODULE PROCEDURE vol7d_ana_init
596END INTERFACE
597
601 MODULE PROCEDURE vol7d_ana_delete
602END INTERFACE
603
607INTERFACE OPERATOR (==)
608 MODULE PROCEDURE vol7d_ana_eq
609END INTERFACE
610
614INTERFACE OPERATOR (/=)
615 MODULE PROCEDURE vol7d_ana_ne
616END INTERFACE
617
618
623INTERFACE OPERATOR (>)
624 MODULE PROCEDURE vol7d_ana_gt
625END INTERFACE
626
631INTERFACE OPERATOR (<)
632 MODULE PROCEDURE vol7d_ana_lt
633END INTERFACE
634
639INTERFACE OPERATOR (>=)
640 MODULE PROCEDURE vol7d_ana_ge
641END INTERFACE
642
647INTERFACE OPERATOR (<=)
648 MODULE PROCEDURE vol7d_ana_le
649END INTERFACE
650
651
654 MODULE PROCEDURE vol7d_ana_c_e
655END INTERFACE
656
660 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
661END INTERFACE
662
666 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
667END INTERFACE
668
669#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
670#define VOL7D_POLY_TYPES _ana
671#define ENABLE_SORT
672#include "array_utilities_pre.F90"
673
676 MODULE PROCEDURE to_char_ana
677END INTERFACE
678
681 MODULE PROCEDURE display_ana
682END INTERFACE
683
684CONTAINS
685
689SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
690TYPE(vol7d_ana),INTENT(INOUT) :: this
691REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
692REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
693CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
694INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
695INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
696
698IF (PRESENT(ident)) THEN
699 this%ident = ident
700ELSE
701 this%ident = cmiss
702ENDIF
703
704END SUBROUTINE vol7d_ana_init
705
706
708SUBROUTINE vol7d_ana_delete(this)
709TYPE(vol7d_ana),INTENT(INOUT) :: this
710
712this%ident = cmiss
713
714END SUBROUTINE vol7d_ana_delete
715
716
717
718character(len=80) function to_char_ana(this)
719
720TYPE(vol7d_ana),INTENT(in) :: this
721
722to_char_ana="ANA: "//&
725 t2c(this%ident,miss="Missing ident")
726
727return
728
729end function to_char_ana
730
731
732subroutine display_ana(this)
733
734TYPE(vol7d_ana),INTENT(in) :: this
735
736print*, trim(to_char(this))
737
738end subroutine display_ana
739
740
741ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
742TYPE(vol7d_ana),INTENT(IN) :: this, that
743LOGICAL :: res
744
745res = this%coord == that%coord .AND. this%ident == that%ident
746
747END FUNCTION vol7d_ana_eq
748
749
750ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
751TYPE(vol7d_ana),INTENT(IN) :: this, that
752LOGICAL :: res
753
754res = .NOT.(this == that)
755
756END FUNCTION vol7d_ana_ne
757
758
759ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
760TYPE(vol7d_ana),INTENT(IN) :: this, that
761LOGICAL :: res
762
763res = this%ident > that%ident
764
765if ( this%ident == that%ident) then
766 res =this%coord > that%coord
767end if
768
769END FUNCTION vol7d_ana_gt
770
771
772ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
773TYPE(vol7d_ana),INTENT(IN) :: this, that
774LOGICAL :: res
775
776res = .not. this < that
777
778END FUNCTION vol7d_ana_ge
779
780
781ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
782TYPE(vol7d_ana),INTENT(IN) :: this, that
783LOGICAL :: res
784
785res = this%ident < that%ident
786
787if ( this%ident == that%ident) then
788 res = this%coord < that%coord
789end if
790
791END FUNCTION vol7d_ana_lt
792
793
794ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
795TYPE(vol7d_ana),INTENT(IN) :: this, that
796LOGICAL :: res
797
798res = .not. (this > that)
799
800END FUNCTION vol7d_ana_le
801
802
803
804ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
805TYPE(vol7d_ana),INTENT(IN) :: this
806LOGICAL :: c_e
807c_e = this /= vol7d_ana_miss
808END FUNCTION vol7d_ana_c_e
809
810
815SUBROUTINE vol7d_ana_read_unit(this, unit)
816TYPE(vol7d_ana),INTENT(out) :: this
817INTEGER, INTENT(in) :: unit
818
819CALL vol7d_ana_vect_read_unit((/this/), unit)
820
821END SUBROUTINE vol7d_ana_read_unit
822
823
828SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
829TYPE(vol7d_ana) :: this(:)
830INTEGER, INTENT(in) :: unit
831
832CHARACTER(len=40) :: form
833
835INQUIRE(unit, form=form)
836IF (form == 'FORMATTED') THEN
837 READ(unit,'(A)')this(:)%ident
838ELSE
839 READ(unit)this(:)%ident
840ENDIF
841
842END SUBROUTINE vol7d_ana_vect_read_unit
843
844
849SUBROUTINE vol7d_ana_write_unit(this, unit)
850TYPE(vol7d_ana),INTENT(in) :: this
851INTEGER, INTENT(in) :: unit
852
853CALL vol7d_ana_vect_write_unit((/this/), unit)
854
855END SUBROUTINE vol7d_ana_write_unit
856
857
862SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
863TYPE(vol7d_ana),INTENT(in) :: this(:)
864INTEGER, INTENT(in) :: unit
865
866CHARACTER(len=40) :: form
867
869INQUIRE(unit, form=form)
870IF (form == 'FORMATTED') THEN
871 WRITE(unit,'(A)')this(:)%ident
872ELSE
873 WRITE(unit)this(:)%ident
874ENDIF
875
876END SUBROUTINE vol7d_ana_vect_write_unit
877
878
879#include "array_utilities_inc.F90"
880
881
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED. Definition: vol7d_ana_class.F90:301 Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED. Definition: vol7d_ana_class.F90:307 Classes for handling georeferenced sparse points in geographical corodinates. Definition: geo_coord_class.F90:216 Definition of constants to be used for declaring variables of a desired type. Definition: kinds.F90:245 Definitions of constants and functions for working with missing values. Definition: missing_values.f90:50 Classe per la gestione dell'anagrafica di stazioni meteo e affini. Definition: vol7d_ana_class.F90:212 Definisce l'anagrafica di una stazione. Definition: vol7d_ana_class.F90:225 |